Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

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

+1-1
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
}
+68
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+
});
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.
+4
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

docs/content/error/compile/iscp.ngdoc

+4
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
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
+4
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
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
+4
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
+4
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
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $compile:utrat
3+
@fullName Unterminated Attribute
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $controller:noscp
3+
@fullName Missing $scope object
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $httpBackend:noxhr
3+
@fullName Unsupported XHR
4+
@description

docs/content/error/index.ngdoc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@ngdoc overview
2+
@name Error Reference
3+
@description
4+
5+
Use the Error Reference manual to find information about error conditions in
6+
your AngularJS app. Errors thrown in production builds of AngularJS will log
7+
links to this site on the console.
8+
9+
Other useful references for debugging your app include:
10+
11+
- {@link api/ API Reference} for detailed information about specific features
12+
- {@link guide/ Developer Guide} for AngularJS concepts
13+
- {@link tutorial/ Tutorial} for getting started
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $injector:cdep
3+
@fullName Circular Dependency
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $injector:itkn
3+
@fullName Bad Injection Token
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $injector:modulerr
3+
@fullName Module Error
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $injector:nomod
3+
@fullName Module Unavailable
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $injector:pget
3+
@fullName Provider Missing $get
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $injector:unpr
3+
@fullName Unknown Provider
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $interpolate:interr
3+
@fullName Interpolation Error
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $interpolate:noconcat
3+
@fullName Multiple Expressions
4+
@description

docs/content/error/jqLite/nosel.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name jqLite:nosel
3+
@fullName Unsupported Selector Lookup
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name jqLite:off_args
3+
@fullName Invalid jqLite#off() parameter
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name jqLite:on_args
3+
@fullName Invalid jqLite#on() Parameters
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $location:istart
3+
@fullName Invalid URL
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $location:nohash
3+
@fullName Missing Hash Prefix
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $location:nopp
3+
@fullName Missing Path Prefix
4+
@description

docs/content/error/ng/areq.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ng:areq
3+
@fullName Bad Argument
4+
@description

docs/content/error/ng/cpi.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ng:cpi
3+
@fullName Bad Copy
4+
@description

docs/content/error/ng/cpws.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ng:cpws
3+
@fullName Copying Window or Scope
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngModel:noass
3+
@fullName Non-Assignable Expression
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngOptions:iexp
3+
@fullName Invalid Expression
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngPattern:noregexp
3+
@fullName Expected Regular Expression
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngRepeat:dupes
3+
@fullName Duplicate Repeater Key
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngRepeat:iexp
3+
@fullName Invalid Expression
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngRepeat:iidexp
3+
@fullName Invalid Identifier
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngResource:badargs
3+
@fullName Too Many Arguments
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name ngSanitize:badparse
3+
@fullName Parsing Error
4+
@description
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $parse:isecfld
3+
@fullName Referencing constructor Field
4+
@description

docs/content/error/parse/isecfn.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $parse:isecfn
3+
@fullName Referencing Function Disallowed
4+
@description

docs/content/error/parse/lexerr.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $parse:lexerr
3+
@fullName Lexer Error
4+
@description

docs/content/error/parse/syntax.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $parse:syntax
3+
@fullName Syntax Error
4+
@description

docs/content/error/parse/ueoe.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $parse:ueoe
3+
@fullName Unexpected End of Expression
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $rootScope:infdig
3+
@fullName Infinite $digest Loop
4+
@description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ngdoc error
2+
@name $rootScope:inprog
3+
@fullName Action Already In Progress
4+
@description

docs/src/gen-docs.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ var reader = require('./reader.js'),
33
writer = require('./writer.js'),
44
SiteMap = require('./SiteMap.js').SiteMap,
55
appCache = require('./appCache.js').appCache,
6-
Q = require('qq');
6+
Q = require('qq'),
7+
errorsJson = require('../../build/errors.json').errors;
78

89
var start = now();
910
var docs;
@@ -22,10 +23,35 @@ writer.makeDir('build/docs/', true).then(function() {
2223
}).then(function generateHtmlDocPartials(docs_) {
2324
docs = docs_;
2425
ngdoc.merge(docs);
25-
var fileFutures = [];
26+
var fileFutures = [], namespace;
27+
28+
var isErrorDocPresent = function (search) {
29+
return docs.some(function (doc) {
30+
return doc.ngdoc === 'error' && doc.name === search;
31+
});
32+
};
33+
34+
// Check that each generated error code has a doc file.
35+
Object.keys(errorsJson).forEach(function (prop) {
36+
if (typeof errorsJson[prop] === 'object') {
37+
namespace = errorsJson[prop];
38+
Object.keys(namespace).forEach(function (code) {
39+
var search = prop + ':' + code;
40+
if (!isErrorDocPresent(search)) {
41+
throw new Error('Missing ngdoc file for error code: ' + search);
42+
}
43+
});
44+
} else {
45+
if (!isErrorDocPresent(prop)) {
46+
throw new Error('Missing ngdoc file for error code: ' + prop);
47+
}
48+
}
49+
});
50+
2651
docs.forEach(function(doc){
2752
// this hack is here because on OSX angular.module and angular.Module map to the same file.
2853
var id = doc.id.replace('angular.Module', 'angular.IModule');
54+
2955
fileFutures.push(writer.output('partials/' + doc.section + '/' + id + '.html', doc.html()));
3056
});
3157

0 commit comments

Comments
 (0)