From 4a7b6a4555a76b19dd217171fc0ddce6707bca95 Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Fri, 12 Jul 2013 17:42:27 -0700 Subject: [PATCH] docs(minErr): Build minErr doc site --- bower.json | 2 +- docs/component-spec/errorDisplaySpec.js | 68 ++++++++ docs/content/error/cacheFactory/iid.ngdoc | 7 + docs/content/error/compile/ctreq.ngdoc | 4 + docs/content/error/compile/iscp.ngdoc | 4 + docs/content/error/compile/multidir.ngdoc | 4 + docs/content/error/compile/noass.ngdoc | 4 + docs/content/error/compile/nodomevents.ngdoc | 4 + docs/content/error/compile/tpload.ngdoc | 4 + docs/content/error/compile/tplrt.ngdoc | 4 + docs/content/error/compile/utrat.ngdoc | 4 + docs/content/error/controller/noscp.ngdoc | 4 + docs/content/error/httpBackend/noxhr.ngdoc | 4 + docs/content/error/index.ngdoc | 13 ++ docs/content/error/injector/cdep.ngdoc | 4 + docs/content/error/injector/itkn.ngdoc | 4 + docs/content/error/injector/modulerr.ngdoc | 4 + docs/content/error/injector/nomod.ngdoc | 4 + docs/content/error/injector/pget.ngdoc | 4 + docs/content/error/injector/unpr.ngdoc | 4 + docs/content/error/interpolate/interr.ngdoc | 4 + docs/content/error/interpolate/noconcat.ngdoc | 4 + docs/content/error/jqLite/nosel.ngdoc | 4 + docs/content/error/jqLite/off_args.ngdoc | 4 + docs/content/error/jqLite/on_args.ngdoc | 4 + docs/content/error/location/istart.ngdoc | 4 + docs/content/error/location/nohash.ngdoc | 4 + docs/content/error/location/nopp.ngdoc | 4 + docs/content/error/ng/areq.ngdoc | 4 + docs/content/error/ng/cpi.ngdoc | 4 + docs/content/error/ng/cpws.ngdoc | 4 + docs/content/error/ngModel/noass.ngdoc | 4 + docs/content/error/ngOptions/iexp.ngdoc | 4 + docs/content/error/ngPattern/noregexp.ngdoc | 4 + docs/content/error/ngRepeat/dupes.ngdoc | 4 + docs/content/error/ngRepeat/iexp.ngdoc | 4 + docs/content/error/ngRepeat/iidexp.ngdoc | 4 + docs/content/error/ngResource/badargs.ngdoc | 4 + docs/content/error/ngSanitize/badparse.ngdoc | 4 + docs/content/error/parse/isecfld.ngdoc | 4 + docs/content/error/parse/isecfn.ngdoc | 4 + docs/content/error/parse/lexerr.ngdoc | 4 + docs/content/error/parse/syntax.ngdoc | 4 + docs/content/error/parse/ueoe.ngdoc | 4 + docs/content/error/rootScope/infdig.ngdoc | 4 + docs/content/error/rootScope/inprog.ngdoc | 4 + docs/src/gen-docs.js | 30 +++- docs/src/ngdoc.js | 156 +++++++++++------- docs/src/templates/css/docs.css | 9 + docs/src/templates/index.html | 12 +- docs/src/templates/js/docs.js | 75 ++++++++- lib/grunt/utils.js | 4 +- 52 files changed, 470 insertions(+), 74 deletions(-) create mode 100644 docs/component-spec/errorDisplaySpec.js create mode 100644 docs/content/error/cacheFactory/iid.ngdoc create mode 100644 docs/content/error/compile/ctreq.ngdoc create mode 100644 docs/content/error/compile/iscp.ngdoc create mode 100644 docs/content/error/compile/multidir.ngdoc create mode 100644 docs/content/error/compile/noass.ngdoc create mode 100644 docs/content/error/compile/nodomevents.ngdoc create mode 100644 docs/content/error/compile/tpload.ngdoc create mode 100644 docs/content/error/compile/tplrt.ngdoc create mode 100644 docs/content/error/compile/utrat.ngdoc create mode 100644 docs/content/error/controller/noscp.ngdoc create mode 100644 docs/content/error/httpBackend/noxhr.ngdoc create mode 100644 docs/content/error/index.ngdoc create mode 100644 docs/content/error/injector/cdep.ngdoc create mode 100644 docs/content/error/injector/itkn.ngdoc create mode 100644 docs/content/error/injector/modulerr.ngdoc create mode 100644 docs/content/error/injector/nomod.ngdoc create mode 100644 docs/content/error/injector/pget.ngdoc create mode 100644 docs/content/error/injector/unpr.ngdoc create mode 100644 docs/content/error/interpolate/interr.ngdoc create mode 100644 docs/content/error/interpolate/noconcat.ngdoc create mode 100644 docs/content/error/jqLite/nosel.ngdoc create mode 100644 docs/content/error/jqLite/off_args.ngdoc create mode 100644 docs/content/error/jqLite/on_args.ngdoc create mode 100644 docs/content/error/location/istart.ngdoc create mode 100644 docs/content/error/location/nohash.ngdoc create mode 100644 docs/content/error/location/nopp.ngdoc create mode 100644 docs/content/error/ng/areq.ngdoc create mode 100644 docs/content/error/ng/cpi.ngdoc create mode 100644 docs/content/error/ng/cpws.ngdoc create mode 100644 docs/content/error/ngModel/noass.ngdoc create mode 100644 docs/content/error/ngOptions/iexp.ngdoc create mode 100644 docs/content/error/ngPattern/noregexp.ngdoc create mode 100644 docs/content/error/ngRepeat/dupes.ngdoc create mode 100644 docs/content/error/ngRepeat/iexp.ngdoc create mode 100644 docs/content/error/ngRepeat/iidexp.ngdoc create mode 100644 docs/content/error/ngResource/badargs.ngdoc create mode 100644 docs/content/error/ngSanitize/badparse.ngdoc create mode 100644 docs/content/error/parse/isecfld.ngdoc create mode 100644 docs/content/error/parse/isecfn.ngdoc create mode 100644 docs/content/error/parse/lexerr.ngdoc create mode 100644 docs/content/error/parse/syntax.ngdoc create mode 100644 docs/content/error/parse/ueoe.ngdoc create mode 100644 docs/content/error/rootScope/infdig.ngdoc create mode 100644 docs/content/error/rootScope/inprog.ngdoc diff --git a/bower.json b/bower.json index ebbd67978d95..0ddcf35745c7 100644 --- a/bower.json +++ b/bower.json @@ -7,6 +7,6 @@ "components-font-awesome": "3.1.0", "bootstrap": "https://raw.github.com/twitter/bootstrap/v2.0.2/docs/assets/bootstrap.zip", "closure-compiler": "https://closure-compiler.googlecode.com/files/compiler-20130603.zip", - "ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.1.1/assets/ng-closure-runner.zip" + "ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.0/assets/ng-closure-runner.zip" } } diff --git a/docs/component-spec/errorDisplaySpec.js b/docs/component-spec/errorDisplaySpec.js new file mode 100644 index 000000000000..8122e2533601 --- /dev/null +++ b/docs/component-spec/errorDisplaySpec.js @@ -0,0 +1,68 @@ +describe("errorDisplay", function () { + + var $location, compileHTML; + + beforeEach(module('docsApp')); + + beforeEach(inject(function ($injector) { + var $rootScope = $injector.get('$rootScope'), + $compile = $injector.get('$compile'); + + $location = $injector.get('$location'); + + compileHTML = function (code) { + var elm = angular.element(code); + $compile(elm)($rootScope); + $rootScope.$digest(); + return elm; + }; + + this.addMatchers({ + toInterpolateTo: function (expected) { + // Given a compiled DOM node with a minerr-display attribute, + // assert that its interpolated string matches the expected text. + return this.actual.text() === expected; + } + }); + })); + + it('should interpolate a template with no parameters', function () { + var elm; + + spyOn($location, 'search').andReturn({}); + elm = compileHTML('
'); + expect(elm).toInterpolateTo('This is a test'); + }); + + it('should interpolate a template with no parameters when search parameters are present', function () { + var elm; + + spyOn($location, 'search').andReturn({ p0: 'foobaz' }); + elm = compileHTML('
'); + expect(elm).toInterpolateTo('This is a test'); + }); + + it('should correctly interpolate search parameters', function () { + var elm; + + spyOn($location, 'search').andReturn({ p0: '42' }); + elm = compileHTML('
'); + expect(elm).toInterpolateTo('The answer is 42'); + }); + + it('should interpolate parameters in the specified order', function () { + var elm; + + spyOn($location, 'search').andReturn({ p0: 'second', p1: 'first' }); + elm = compileHTML('
'); + expect(elm).toInterpolateTo('first second'); + }); + + it('should preserve interpolation markers when fewer arguments than needed are provided', function () { + var elm; + + spyOn($location, 'search').andReturn({ p0: 'Fooooo' }); + elm = compileHTML('
'); + expect(elm).toInterpolateTo('This Fooooo is {1} on {2}'); + }); +}); \ No newline at end of file diff --git a/docs/content/error/cacheFactory/iid.ngdoc b/docs/content/error/cacheFactory/iid.ngdoc new file mode 100644 index 000000000000..e3f32166fc4b --- /dev/null +++ b/docs/content/error/cacheFactory/iid.ngdoc @@ -0,0 +1,7 @@ +@ngdoc error +@name $cacheFactory:iid +@fullName Invalid ID +@description + +This error occurs when trying to create a new `cacheFactory` object with a +specified cache ID, but the cache ID is already taken. \ No newline at end of file diff --git a/docs/content/error/compile/ctreq.ngdoc b/docs/content/error/compile/ctreq.ngdoc new file mode 100644 index 000000000000..065533b7da19 --- /dev/null +++ b/docs/content/error/compile/ctreq.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:ctreq +@fullName Missing Required Controller +@description diff --git a/docs/content/error/compile/iscp.ngdoc b/docs/content/error/compile/iscp.ngdoc new file mode 100644 index 000000000000..afdbd4c4e8d1 --- /dev/null +++ b/docs/content/error/compile/iscp.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:iscp +@fullName Invalid Isolate Scope +@description diff --git a/docs/content/error/compile/multidir.ngdoc b/docs/content/error/compile/multidir.ngdoc new file mode 100644 index 000000000000..4e893c3e555c --- /dev/null +++ b/docs/content/error/compile/multidir.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:multidir +@fullName Multiple Directive Resource Contention +@description diff --git a/docs/content/error/compile/noass.ngdoc b/docs/content/error/compile/noass.ngdoc new file mode 100644 index 000000000000..bb247499ec56 --- /dev/null +++ b/docs/content/error/compile/noass.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:noass +@fullName Non-Assignable Expression +@description diff --git a/docs/content/error/compile/nodomevents.ngdoc b/docs/content/error/compile/nodomevents.ngdoc new file mode 100644 index 000000000000..421e896f2498 --- /dev/null +++ b/docs/content/error/compile/nodomevents.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:nodomevents +@fullName Interpolated Event Attributes +@description diff --git a/docs/content/error/compile/tpload.ngdoc b/docs/content/error/compile/tpload.ngdoc new file mode 100644 index 000000000000..78826abb1c5a --- /dev/null +++ b/docs/content/error/compile/tpload.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:tpload +@fullName Template Loader Error +@description diff --git a/docs/content/error/compile/tplrt.ngdoc b/docs/content/error/compile/tplrt.ngdoc new file mode 100644 index 000000000000..4afd88cd20f9 --- /dev/null +++ b/docs/content/error/compile/tplrt.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:tplrt +@fullName Invalid Template Root +@description diff --git a/docs/content/error/compile/utrat.ngdoc b/docs/content/error/compile/utrat.ngdoc new file mode 100644 index 000000000000..64ffa22371fe --- /dev/null +++ b/docs/content/error/compile/utrat.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $compile:utrat +@fullName Unterminated Attribute +@description diff --git a/docs/content/error/controller/noscp.ngdoc b/docs/content/error/controller/noscp.ngdoc new file mode 100644 index 000000000000..f9e89487fb4f --- /dev/null +++ b/docs/content/error/controller/noscp.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $controller:noscp +@fullName Missing $scope object +@description diff --git a/docs/content/error/httpBackend/noxhr.ngdoc b/docs/content/error/httpBackend/noxhr.ngdoc new file mode 100644 index 000000000000..a311620f7fed --- /dev/null +++ b/docs/content/error/httpBackend/noxhr.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $httpBackend:noxhr +@fullName Unsupported XHR +@description diff --git a/docs/content/error/index.ngdoc b/docs/content/error/index.ngdoc new file mode 100644 index 000000000000..9512dc9c9337 --- /dev/null +++ b/docs/content/error/index.ngdoc @@ -0,0 +1,13 @@ +@ngdoc overview +@name Error Reference +@description + +Use the Error Reference manual to find information about error conditions in +your AngularJS app. Errors thrown in production builds of AngularJS will log +links to this site on the console. + +Other useful references for debugging your app include: + +- {@link api/ API Reference} for detailed information about specific features +- {@link guide/ Developer Guide} for AngularJS concepts +- {@link tutorial/ Tutorial} for getting started diff --git a/docs/content/error/injector/cdep.ngdoc b/docs/content/error/injector/cdep.ngdoc new file mode 100644 index 000000000000..f4a9c9098399 --- /dev/null +++ b/docs/content/error/injector/cdep.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $injector:cdep +@fullName Circular Dependency +@description diff --git a/docs/content/error/injector/itkn.ngdoc b/docs/content/error/injector/itkn.ngdoc new file mode 100644 index 000000000000..fab64696a4ba --- /dev/null +++ b/docs/content/error/injector/itkn.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $injector:itkn +@fullName Bad Injection Token +@description diff --git a/docs/content/error/injector/modulerr.ngdoc b/docs/content/error/injector/modulerr.ngdoc new file mode 100644 index 000000000000..5d2aa8f8131d --- /dev/null +++ b/docs/content/error/injector/modulerr.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $injector:modulerr +@fullName Module Error +@description diff --git a/docs/content/error/injector/nomod.ngdoc b/docs/content/error/injector/nomod.ngdoc new file mode 100644 index 000000000000..6dd4c16978cd --- /dev/null +++ b/docs/content/error/injector/nomod.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $injector:nomod +@fullName Module Unavailable +@description diff --git a/docs/content/error/injector/pget.ngdoc b/docs/content/error/injector/pget.ngdoc new file mode 100644 index 000000000000..3eca8d800a83 --- /dev/null +++ b/docs/content/error/injector/pget.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $injector:pget +@fullName Provider Missing $get +@description diff --git a/docs/content/error/injector/unpr.ngdoc b/docs/content/error/injector/unpr.ngdoc new file mode 100644 index 000000000000..5459711fe63b --- /dev/null +++ b/docs/content/error/injector/unpr.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $injector:unpr +@fullName Unknown Provider +@description diff --git a/docs/content/error/interpolate/interr.ngdoc b/docs/content/error/interpolate/interr.ngdoc new file mode 100644 index 000000000000..a36a1d7dddd3 --- /dev/null +++ b/docs/content/error/interpolate/interr.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $interpolate:interr +@fullName Interpolation Error +@description diff --git a/docs/content/error/interpolate/noconcat.ngdoc b/docs/content/error/interpolate/noconcat.ngdoc new file mode 100644 index 000000000000..f1fd6c461226 --- /dev/null +++ b/docs/content/error/interpolate/noconcat.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $interpolate:noconcat +@fullName Multiple Expressions +@description diff --git a/docs/content/error/jqLite/nosel.ngdoc b/docs/content/error/jqLite/nosel.ngdoc new file mode 100644 index 000000000000..c776c1531150 --- /dev/null +++ b/docs/content/error/jqLite/nosel.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name jqLite:nosel +@fullName Unsupported Selector Lookup +@description diff --git a/docs/content/error/jqLite/off_args.ngdoc b/docs/content/error/jqLite/off_args.ngdoc new file mode 100644 index 000000000000..88a981e36de4 --- /dev/null +++ b/docs/content/error/jqLite/off_args.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name jqLite:off_args +@fullName Invalid jqLite#off() parameter +@description diff --git a/docs/content/error/jqLite/on_args.ngdoc b/docs/content/error/jqLite/on_args.ngdoc new file mode 100644 index 000000000000..974f20a84edf --- /dev/null +++ b/docs/content/error/jqLite/on_args.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name jqLite:on_args +@fullName Invalid jqLite#on() Parameters +@description diff --git a/docs/content/error/location/istart.ngdoc b/docs/content/error/location/istart.ngdoc new file mode 100644 index 000000000000..006689e46464 --- /dev/null +++ b/docs/content/error/location/istart.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $location:istart +@fullName Invalid URL +@description diff --git a/docs/content/error/location/nohash.ngdoc b/docs/content/error/location/nohash.ngdoc new file mode 100644 index 000000000000..81f0d569c25b --- /dev/null +++ b/docs/content/error/location/nohash.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $location:nohash +@fullName Missing Hash Prefix +@description diff --git a/docs/content/error/location/nopp.ngdoc b/docs/content/error/location/nopp.ngdoc new file mode 100644 index 000000000000..3d95b7ff0529 --- /dev/null +++ b/docs/content/error/location/nopp.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $location:nopp +@fullName Missing Path Prefix +@description diff --git a/docs/content/error/ng/areq.ngdoc b/docs/content/error/ng/areq.ngdoc new file mode 100644 index 000000000000..ade8a5bad2cb --- /dev/null +++ b/docs/content/error/ng/areq.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ng:areq +@fullName Bad Argument +@description diff --git a/docs/content/error/ng/cpi.ngdoc b/docs/content/error/ng/cpi.ngdoc new file mode 100644 index 000000000000..95b300246b71 --- /dev/null +++ b/docs/content/error/ng/cpi.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ng:cpi +@fullName Bad Copy +@description diff --git a/docs/content/error/ng/cpws.ngdoc b/docs/content/error/ng/cpws.ngdoc new file mode 100644 index 000000000000..2f7a9c5b6685 --- /dev/null +++ b/docs/content/error/ng/cpws.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ng:cpws +@fullName Copying Window or Scope +@description diff --git a/docs/content/error/ngModel/noass.ngdoc b/docs/content/error/ngModel/noass.ngdoc new file mode 100644 index 000000000000..c9fe66372784 --- /dev/null +++ b/docs/content/error/ngModel/noass.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngModel:noass +@fullName Non-Assignable Expression +@description diff --git a/docs/content/error/ngOptions/iexp.ngdoc b/docs/content/error/ngOptions/iexp.ngdoc new file mode 100644 index 000000000000..4fc4b8d24718 --- /dev/null +++ b/docs/content/error/ngOptions/iexp.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngOptions:iexp +@fullName Invalid Expression +@description diff --git a/docs/content/error/ngPattern/noregexp.ngdoc b/docs/content/error/ngPattern/noregexp.ngdoc new file mode 100644 index 000000000000..bc2f56d6ee63 --- /dev/null +++ b/docs/content/error/ngPattern/noregexp.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngPattern:noregexp +@fullName Expected Regular Expression +@description diff --git a/docs/content/error/ngRepeat/dupes.ngdoc b/docs/content/error/ngRepeat/dupes.ngdoc new file mode 100644 index 000000000000..eb25ec6766da --- /dev/null +++ b/docs/content/error/ngRepeat/dupes.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngRepeat:dupes +@fullName Duplicate Repeater Key +@description diff --git a/docs/content/error/ngRepeat/iexp.ngdoc b/docs/content/error/ngRepeat/iexp.ngdoc new file mode 100644 index 000000000000..18701776a36e --- /dev/null +++ b/docs/content/error/ngRepeat/iexp.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngRepeat:iexp +@fullName Invalid Expression +@description diff --git a/docs/content/error/ngRepeat/iidexp.ngdoc b/docs/content/error/ngRepeat/iidexp.ngdoc new file mode 100644 index 000000000000..f9aa7c5096ff --- /dev/null +++ b/docs/content/error/ngRepeat/iidexp.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngRepeat:iidexp +@fullName Invalid Identifier +@description diff --git a/docs/content/error/ngResource/badargs.ngdoc b/docs/content/error/ngResource/badargs.ngdoc new file mode 100644 index 000000000000..9686f7a31c26 --- /dev/null +++ b/docs/content/error/ngResource/badargs.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngResource:badargs +@fullName Too Many Arguments +@description diff --git a/docs/content/error/ngSanitize/badparse.ngdoc b/docs/content/error/ngSanitize/badparse.ngdoc new file mode 100644 index 000000000000..fd184e14bbd7 --- /dev/null +++ b/docs/content/error/ngSanitize/badparse.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name ngSanitize:badparse +@fullName Parsing Error +@description diff --git a/docs/content/error/parse/isecfld.ngdoc b/docs/content/error/parse/isecfld.ngdoc new file mode 100644 index 000000000000..7489baf7fbfe --- /dev/null +++ b/docs/content/error/parse/isecfld.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $parse:isecfld +@fullName Referencing constructor Field +@description diff --git a/docs/content/error/parse/isecfn.ngdoc b/docs/content/error/parse/isecfn.ngdoc new file mode 100644 index 000000000000..1e932f3009b8 --- /dev/null +++ b/docs/content/error/parse/isecfn.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $parse:isecfn +@fullName Referencing Function Disallowed +@description diff --git a/docs/content/error/parse/lexerr.ngdoc b/docs/content/error/parse/lexerr.ngdoc new file mode 100644 index 000000000000..f03cb93b258c --- /dev/null +++ b/docs/content/error/parse/lexerr.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $parse:lexerr +@fullName Lexer Error +@description diff --git a/docs/content/error/parse/syntax.ngdoc b/docs/content/error/parse/syntax.ngdoc new file mode 100644 index 000000000000..122eda21b313 --- /dev/null +++ b/docs/content/error/parse/syntax.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $parse:syntax +@fullName Syntax Error +@description diff --git a/docs/content/error/parse/ueoe.ngdoc b/docs/content/error/parse/ueoe.ngdoc new file mode 100644 index 000000000000..726d15c3dc53 --- /dev/null +++ b/docs/content/error/parse/ueoe.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $parse:ueoe +@fullName Unexpected End of Expression +@description diff --git a/docs/content/error/rootScope/infdig.ngdoc b/docs/content/error/rootScope/infdig.ngdoc new file mode 100644 index 000000000000..82bcc075472e --- /dev/null +++ b/docs/content/error/rootScope/infdig.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $rootScope:infdig +@fullName Infinite $digest Loop +@description diff --git a/docs/content/error/rootScope/inprog.ngdoc b/docs/content/error/rootScope/inprog.ngdoc new file mode 100644 index 000000000000..ce1151d06af1 --- /dev/null +++ b/docs/content/error/rootScope/inprog.ngdoc @@ -0,0 +1,4 @@ +@ngdoc error +@name $rootScope:inprog +@fullName Action Already In Progress +@description diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index f8ca5548fc95..2e711ab31c81 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -3,7 +3,8 @@ var reader = require('./reader.js'), writer = require('./writer.js'), SiteMap = require('./SiteMap.js').SiteMap, appCache = require('./appCache.js').appCache, - Q = require('qq'); + Q = require('qq'), + errorsJson = require('../../build/errors.json').errors; var start = now(); var docs; @@ -22,10 +23,35 @@ writer.makeDir('build/docs/', true).then(function() { }).then(function generateHtmlDocPartials(docs_) { docs = docs_; ngdoc.merge(docs); - var fileFutures = []; + var fileFutures = [], namespace; + + var isErrorDocPresent = function (search) { + return docs.some(function (doc) { + return doc.ngdoc === 'error' && doc.name === search; + }); + }; + + // Check that each generated error code has a doc file. + Object.keys(errorsJson).forEach(function (prop) { + if (typeof errorsJson[prop] === 'object') { + namespace = errorsJson[prop]; + Object.keys(namespace).forEach(function (code) { + var search = prop + ':' + code; + if (!isErrorDocPresent(search)) { + throw new Error('Missing ngdoc file for error code: ' + search); + } + }); + } else { + if (!isErrorDocPresent(prop)) { + throw new Error('Missing ngdoc file for error code: ' + prop); + } + } + }); + docs.forEach(function(doc){ // this hack is here because on OSX angular.module and angular.Module map to the same file. var id = doc.id.replace('angular.Module', 'angular.IModule'); + fileFutures.push(writer.output('partials/' + doc.section + '/' + id + '.html', doc.html())); }); diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index f5f22ee84ef8..4ad478f499bc 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -13,6 +13,22 @@ var fspath = require('path'); var markdown = new Showdown.converter({ extensions : ['table'] }); var shell = require('shelljs'); var gruntUtil = require('../../lib/grunt/utils.js'); +var errorsJson; + +var lookupMinerrMsg = function (doc) { + var code, namespace; + + if (errorsJson === undefined) { + errorsJson = require('../../build/errors.json').errors; + } + + namespace = doc.getMinerrNamespace(); + code = doc.getMinerrCode(); + if (namespace === undefined) { + return errorsJson[code]; + } + return errorsJson[namespace][code]; +}; exports.trim = trim; exports.metadata = metadata; @@ -98,6 +114,22 @@ Doc.prototype = { return words.join(' '); }, + getMinerrNamespace: function () { + if (this.ngdoc !== 'error') { + throw new Error('Tried to get the minErr namespace, but @ngdoc ' + + this.ngdoc + ' was supplied. It should be @ngdoc error'); + } + return this.name.split(':')[0]; + }, + + getMinerrCode: function () { + if (this.ngdoc !== 'error') { + throw new Error('Tried to get the minErr error code, but @ngdoc ' + + this.ngdoc + ' was supplied. It should be @ngdoc error'); + } + return this.name.split(':')[1]; + }, + /** * Converts relative urls (without section) into absolute * Absolute url means url with section @@ -325,6 +357,7 @@ Doc.prototype = { flush(); this.shortName = this.name.split(/[\.:#]/).pop().trim(); this.id = this.id || // if we have an id just use it + (this.ngdoc === 'error' ? this.name : '') || (((this.file||'').match(/.*(\/|\\)([^(\/|\\)]*)\.ngdoc/)||{})[2]) || // try to extract it from file name this.name; // default to name this.description = this.markdown(this.description); @@ -391,20 +424,33 @@ Doc.prototype = { html: function() { var dom = new DOM(), - self = this; - - dom.h(title(this.name), function() { + self = this, + minerrMsg; + + if (this.section === 'api') { + dom.tag('a', { + href: 'http://github.com/angular/angular.js/tree/v' + + gruntUtil.getVersion().number + '/' + self.file + '#L' + self.line, + class: 'view-source btn btn-action' }, function(dom) { + dom.tag('i', {class:'icon-zoom-in'}, ' '); + dom.text(' View source'); + }); + } + dom.tag('a', { + href: 'http://github.com/angular/angular.js/edit/master/' + self.file, + class: 'improve-docs btn btn-primary' }, function(dom) { + dom.tag('i', {class:'icon-edit'}, ' '); + dom.text(' Improve this doc'); + }); + dom.h(title(this), function() { notice('deprecated', 'Deprecated API', self.deprecated); - dom.tag('a', {href: 'http://github.com/angular/angular.js/edit/master/' + self.file, class: 'improve-docs btn btn-primary'}, function(dom) { - dom.tag('i', {class:'icon-edit'}, ' '); - dom.text(' Improve this doc'); - }); - if (self.section === 'api') { - dom.tag('a', {href: 'http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().number + '/' + self.file + '#L' + self.line, class: 'view-source btn btn-action'}, function(dom) { - dom.tag('i', {class:'icon-zoom-in'}, ' '); - dom.text(' View source'); - }); + if (self.ngdoc === 'error') { + minerrMsg = lookupMinerrMsg(self); + dom.tag('pre', { + class:'minerr-errmsg', + 'error-display': minerrMsg + }, minerrMsg); } if (self.ngdoc != 'overview') { dom.h('Description', self.description, dom.html); @@ -763,6 +809,10 @@ Doc.prototype = { dom.html(this.description); }, + html_usage_error: function (dom) { + dom.html(); + }, + html_usage_interface: function(dom){ var self = this; @@ -878,62 +928,50 @@ var GLOBALS = /^angular\.([^\.]+)$/, MODULE_TYPE = /^((?:(?!^angular\.)[^\.])+)\..+\.([A-Z][^\.]+)$/; -function title(text) { - if (!text) return text; +function title(doc) { + if (!doc.name) return doc.name; var match, - module, - type, - name; - - if (text == 'angular.Module') { - module = 'ng'; - name = 'Module'; - type = 'Type'; + text = doc.name; + + var makeTitle = function (name, type, componentType, component) { + // Makes title markup. + // makeTitle('Foo', 'directive', 'module', 'ng') -> + // Foo is a directive in module ng + return function () { + this.tag('code', name); + this.tag('div', function () { + this.tag('span', {class: 'hint'}, function () { + if (type && component) { + this.text(type + ' in ' + componentType + ' '); + this.tag('code', component); + } + }); + }); + }; + }; + + if (doc.ngdoc === 'error') { + return makeTitle(doc.fullName, 'error', 'component', doc.getMinerrNamespace()); + } else if (text == 'angular.Module') { + return makeTitle('Module', 'Type', 'module', 'ng'); } else if (match = text.match(GLOBALS)) { - module = 'ng'; - name = 'angular.' + match[1]; - type = 'API'; + return makeTitle('angular.' + match[1], 'API', 'module', 'ng'); } else if (match = text.match(MODULE)) { - module = match[1]; + return makeTitle('', '', 'module', match[1]); } else if (match = text.match(MODULE_MOCK)) { - module = 'ng'; - name = 'angular.mock.' + match[1]; - type = 'API'; + return makeTitle('angular.mock.' + match[1], 'API', 'module', 'ng'); } else if (match = text.match(MODULE_DIRECTIVE)) { - module = match[1]; - name = match[2]; - type = 'directive'; + return makeTitle(match[2], 'directive', 'module', match[1]); } else if (match = text.match(MODULE_DIRECTIVE_INPUT)) { - module = match[1]; - name = 'input [' + match[2] + ']'; - type = 'directive'; + return makeTitle('input [' + match[2] + ']', 'directive', 'module', match[1]); } else if (match = text.match(MODULE_FILTER)) { - module = match[1]; - name = match[2]; - type = 'filter'; + return makeTitle(match[2], 'filter', 'module', match[1]); } else if (match = text.match(MODULE_SERVICE)) { - module = match[1]; - name = match[2] + (match[3] || ''); - type = 'service'; + return makeTitle(match[2] + (match[3] || ''), 'service', 'module', match[1]); } else if (match = text.match(MODULE_TYPE)) { - module = match[1]; - name = match[2]; - type = 'type'; - } else { - return text; + return makeTitle(match[2], 'type', 'module', match[1]); } - return function() { - this.tag('code', name); - this.tag('span', { class: 'hint'}, function() { - if (type) { - this.text('('); - this.text(type); - this.text(' in module '); - this.tag('code', module); - this.text(')'); - } - }); - }; + return text; } @@ -988,7 +1026,7 @@ function metadata(docs){ pages.push({ section: doc.section, id: doc.id, - name: title(doc.name), + name: title(doc), shortName: shortName, type: doc.ngdoc, keywords:doc.keywords() diff --git a/docs/src/templates/css/docs.css b/docs/src/templates/css/docs.css index f4a86ba5e783..6b1e65275fc7 100644 --- a/docs/src/templates/css/docs.css +++ b/docs/src/templates/css/docs.css @@ -476,3 +476,12 @@ pre ol li { width:180px; margin-bottom:20px; } + +.minerr-errmsg { + clear: both; + position: relative; + top: 10px; + font-size: 16px; + word-break: normal; + word-wrap: normal; +} \ No newline at end of file diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 4bf368388e7c..65e26c99ecb6 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -18,7 +18,7 @@ // before the base attribute is added, causing 404 and terribly slow loading of the docs app. (function() { var indexFile = (location.pathname.match(/\/(index[^\.]*\.html)/) || ['', ''])[1], - rUrl = /(#!\/|api|guide|misc|tutorial|cookbook|index[^\.]*\.html).*$/, + rUrl = /(#!\/|api|guide|misc|tutorial|cookbook|error|index[^\.]*\.html).*$/, baseUrl = location.href.replace(rUrl, indexFile), jQuery = /index-jq[^\.]*\.html$/.test(baseUrl), debug = /index[^\.]*-debug\.html$/.test(baseUrl), @@ -150,6 +150,7 @@
  • Tutorial
  • Developer Guide
  • API Reference
  • +
  • Error Reference
  • Contribute
  • Download
  • @@ -263,7 +264,16 @@

    {{ key }}

    + +