X Tutup
Skip to content

Commit 4a7b6a4

Browse files
committed
docs(minErr): Build minErr doc site
1 parent dca2317 commit 4a7b6a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+470
-74
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"components-font-awesome": "3.1.0",
88
"bootstrap": "https://raw.github.com/twitter/bootstrap/v2.0.2/docs/assets/bootstrap.zip",
99
"closure-compiler": "https://closure-compiler.googlecode.com/files/compiler-20130603.zip",
10-
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.1.1/assets/ng-closure-runner.zip"
10+
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.0/assets/ng-closure-runner.zip"
1111
}
1212
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
describe("errorDisplay", function () {
2+
3+
var $location, compileHTML;
4+
5+
beforeEach(module('docsApp'));
6+
7+
beforeEach(inject(function ($injector) {
8+
var $rootScope = $injector.get('$rootScope'),
9+
$compile = $injector.get('$compile');
10+
11+
$location = $injector.get('$location');
12+
13+
compileHTML = function (code) {
14+
var elm = angular.element(code);
15+
$compile(elm)($rootScope);
16+
$rootScope.$digest();
17+
return elm;
18+
};
19+
20+
this.addMatchers({
21+
toInterpolateTo: function (expected) {
22+
// Given a compiled DOM node with a minerr-display attribute,
23+
// assert that its interpolated string matches the expected text.
24+
return this.actual.text() === expected;
25+
}
26+
});
27+
}));
28+
29+
it('should interpolate a template with no parameters', function () {
30+
var elm;
31+
32+
spyOn($location, 'search').andReturn({});
33+
elm = compileHTML('<div error-display="This is a test"></div>');
34+
expect(elm).toInterpolateTo('This is a test');
35+
});
36+
37+
it('should interpolate a template with no parameters when search parameters are present', function () {
38+
var elm;
39+
40+
spyOn($location, 'search').andReturn({ p0: 'foobaz' });
41+
elm = compileHTML('<div error-display="This is a test"></div>');
42+
expect(elm).toInterpolateTo('This is a test');
43+
});
44+
45+
it('should correctly interpolate search parameters', function () {
46+
var elm;
47+
48+
spyOn($location, 'search').andReturn({ p0: '42' });
49+
elm = compileHTML('<div error-display="The answer is {0}"></div>');
50+
expect(elm).toInterpolateTo('The answer is 42');
51+
});
52+
53+
it('should interpolate parameters in the specified order', function () {
54+
var elm;
55+
56+
spyOn($location, 'search').andReturn({ p0: 'second', p1: 'first' });
57+
elm = compileHTML('<div error-display="{1} {0}"></div>');
58+
expect(elm).toInterpolateTo('first second');
59+
});
60+
61+
it('should preserve interpolation markers when fewer arguments than needed are provided', function () {
62+
var elm;
63+
64+
spyOn($location, 'search').andReturn({ p0: 'Fooooo' });
65+
elm = compileHTML('<div error-display="This {0} is {1} on {2}"></div>');
66+
expect(elm).toInterpolateTo('This Fooooo is {1} on {2}');
67+
});
68+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@ngdoc error
2+
@name $cacheFactory:iid
3+
@fullName Invalid ID
4+
@description
5+
6+
This error occurs when trying to create a new `cacheFactory` object with a
7+
specified cache ID, but the cache ID is already taken.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:ctreq
3+
@fullName Missing Required Controller
4+
@description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:iscp
3+
@fullName Invalid Isolate Scope
4+
@description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:multidir
3+
@fullName Multiple Directive Resource Contention
4+
@description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:noass
3+
@fullName Non-Assignable Expression
4+
@description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:nodomevents
3+
@fullName Interpolated Event Attributes
4+
@description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:tpload
3+
@fullName Template Loader Error
4+
@description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:tplrt
3+
@fullName Invalid Template Root
4+
@description

0 commit comments

Comments
 (0)
X Tutup