├── docs ├── content │ ├── notes │ │ └── empty.tmp │ ├── error │ │ ├── $interpolate │ │ │ ├── badexpr.ngdoc │ │ │ ├── untermstr.ngdoc │ │ │ ├── reqendinterp.ngdoc │ │ │ ├── interr.ngdoc │ │ │ ├── wantstring.ngdoc │ │ │ ├── reqendbrace.ngdoc │ │ │ ├── dupvalue.ngdoc │ │ │ ├── reqcomma.ngdoc │ │ │ ├── unsafe.ngdoc │ │ │ ├── unknarg.ngdoc │ │ │ ├── noconcat.ngdoc │ │ │ ├── reqopenbrace.ngdoc │ │ │ ├── reqarg.ngdoc │ │ │ ├── logicbug.ngdoc │ │ │ ├── reqother.ngdoc │ │ │ └── nochgmustache.ngdoc │ │ ├── $animate │ │ │ ├── notcsel.ngdoc │ │ │ └── nocb.ngdoc │ │ ├── ng │ │ │ ├── cpta.ngdoc │ │ │ ├── areq.ngdoc │ │ │ ├── badname.ngdoc │ │ │ ├── test.ngdoc │ │ │ ├── cpi.ngdoc │ │ │ ├── cpws.ngdoc │ │ │ └── btstrpd.ngdoc │ │ ├── $sce │ │ │ ├── itype.ngdoc │ │ │ ├── icontext.ngdoc │ │ │ ├── imatcher.ngdoc │ │ │ ├── iwcard.ngdoc │ │ │ ├── iequirks.ngdoc │ │ │ └── unsafe.ngdoc │ │ ├── jqLite │ │ │ ├── offargs.ngdoc │ │ │ ├── onargs.ngdoc │ │ │ └── nosel.ngdoc │ │ ├── $compile │ │ │ ├── baddir.ngdoc │ │ │ ├── noctrl.ngdoc │ │ │ ├── tpload.ngdoc │ │ │ ├── multidir.ngdoc │ │ │ ├── iscp.ngdoc │ │ │ ├── selmulti.ngdoc │ │ │ ├── nodomevents.ngdoc │ │ │ └── uterdir.ngdoc │ │ ├── $cacheFactory │ │ │ └── iid.ngdoc │ │ ├── ngPattern │ │ │ └── noregexp.ngdoc │ │ ├── $resource │ │ │ ├── badname.ngdoc │ │ │ ├── badargs.ngdoc │ │ │ ├── badcfg.ngdoc │ │ │ └── badmember.ngdoc │ │ ├── $parse │ │ │ ├── isecobj.ngdoc │ │ │ ├── lexerr.ngdoc │ │ │ ├── ueoe.ngdoc │ │ │ ├── isecfn.ngdoc │ │ │ ├── syntax.ngdoc │ │ │ ├── isecff.ngdoc │ │ │ ├── isecwindow.ngdoc │ │ │ └── isecfld.ngdoc │ │ ├── $location │ │ │ ├── isrcharg.ngdoc │ │ │ ├── ipthprfx.ngdoc │ │ │ └── nostate.ngdoc │ │ ├── $q │ │ │ ├── norslvr.ngdoc │ │ │ └── qcycle.ngdoc │ │ ├── ngOptions │ │ │ └── iexp.ngdoc │ │ ├── ngModel │ │ │ ├── datefmt.ngdoc │ │ │ ├── constexpr.ngdoc │ │ │ └── nonassign.ngdoc │ │ ├── $sanitize │ │ │ └── badparse.ngdoc │ │ ├── index.ngdoc │ │ ├── ngTransclude │ │ │ └── orphan.ngdoc │ │ ├── ngRepeat │ │ │ ├── iexp.ngdoc │ │ │ ├── iidexp.ngdoc │ │ │ ├── dupes.ngdoc │ │ │ └── badident.ngdoc │ │ ├── $injector │ │ │ ├── pget.ngdoc │ │ │ ├── cdep.ngdoc │ │ │ ├── undef.ngdoc │ │ │ ├── itkn.ngdoc │ │ │ ├── modulerr.ngdoc │ │ │ └── nomod.ngdoc │ │ ├── $controller │ │ │ ├── noscp.ngdoc │ │ │ └── ctrlfmt.ngdoc │ │ ├── $http │ │ │ └── badreq.ngdoc │ │ └── $rootScope │ │ │ └── infdig.ngdoc │ ├── misc │ │ └── index.ngdoc │ ├── tutorial │ │ ├── the_end.ngdoc │ │ └── step_01.ngdoc │ └── guide │ │ └── ie.ngdoc ├── app │ ├── assets │ │ ├── css │ │ │ └── animations.css │ │ ├── favicon.ico │ │ ├── img │ │ │ ├── bullet.png │ │ │ ├── AngularJS-small.png │ │ │ ├── glyphicons-halflings.png │ │ │ └── glyphicons-halflings-white.png │ │ ├── Error404.html │ │ └── js │ │ │ └── search-worker.js │ ├── e2e │ │ ├── api-docs │ │ │ ├── provider-pages.scenario.js │ │ │ └── service-pages.scenario.js │ │ └── .jshintrc │ ├── src │ │ ├── app.js │ │ ├── versions.js │ │ └── directives.js │ └── test │ │ ├── directivesSpec.js │ │ └── docsSpec.js ├── config │ ├── templates │ │ ├── json-doc.template.json │ │ ├── tutorial.template.html │ │ ├── pages-data.template.js │ │ ├── nav-data.template.js │ │ ├── versions-data.template.js │ │ ├── error.template.html │ │ ├── errorNamespace.template.html │ │ └── runnableExample.template.html │ ├── tag-defs │ │ ├── sortOrder.js │ │ └── tutorial-step.js │ ├── services │ │ ├── errorNamespaceMap.js │ │ ├── getMinerrInfo.js │ │ ├── getVersion.js │ │ └── deployments │ │ │ ├── debug.js │ │ │ └── default.js │ ├── inline-tag-defs │ │ └── type.js │ └── processors │ │ ├── versions-data.js │ │ └── index-page.js ├── img │ ├── helloworld.png │ ├── angular_parts.png │ ├── form_data_flow.png │ ├── helloworld_2way.png │ ├── One_Way_Data_Binding.png │ ├── Two_Way_Data_Binding.png │ ├── guide │ │ ├── concepts-scope.png │ │ ├── concepts-view.png │ │ ├── forms-debounce.gif │ │ ├── concepts-runtime.png │ │ ├── concepts-startup.png │ │ ├── dom_scope_final.png │ │ ├── scenario_runner.png │ │ ├── concepts-directive.png │ │ ├── di_sequence_final.png │ │ ├── simple_scope_final.png │ │ ├── concepts-databinding1.png │ │ ├── concepts-databinding2.png │ │ ├── forms-update-on-blur.gif │ │ ├── concepts-module-injector.png │ │ ├── concepts-module-service.png │ │ ├── hashbang_vs_regular_url.jpg │ │ └── concepts-scope-watch-strategies.png │ └── tutorial │ │ ├── tutorial_00.png │ │ ├── tutorial_02.png │ │ ├── tutorial_03.png │ │ ├── tutorial_04.png │ │ ├── tutorial_05.png │ │ ├── tutorial_05.pptx │ │ ├── catalog_screen.png │ │ ├── tutorial_00_final.png │ │ ├── tutorial_07_final.png │ │ ├── xhr_service_final.png │ │ ├── tutorial_08-09_final.png │ │ └── tutorial_10-11_final.png ├── bower.json └── protractor-conf.js ├── logs └── .gitignore ├── test ├── e2e │ ├── tools │ │ ├── .jshintrc │ │ ├── index.js │ │ ├── util.js │ │ └── middleware.js │ ├── fixtures │ │ ├── .jshintrc │ │ ├── sample │ │ │ ├── script.js │ │ │ └── index.html │ │ ├── ngJq │ │ │ ├── script.js │ │ │ └── index.html │ │ └── ngJqJquery │ │ │ ├── script.js │ │ │ └── index.html │ └── tests │ │ ├── .jshintrc │ │ ├── sampleSpec.js │ │ ├── ngJqSpec.js │ │ └── helpers │ │ └── main.js ├── jquery_alias.js ├── jquery_remove.js ├── ngScenario │ ├── e2e │ │ ├── style.css │ │ ├── Runner-compiled.html │ │ └── Runner.html │ ├── mocks.js │ ├── output │ │ ├── jsonSpec.js │ │ └── objectSpec.js │ └── ScenarioSpec.js ├── ngAnimate │ ├── bodySpec.js │ └── .jshintrc ├── ng │ ├── windowSpec.js │ ├── rootElementSpec.js │ ├── directive │ │ ├── ngClickSpec.js │ │ ├── ngKeySpec.js │ │ ├── ngSrcsetSpec.js │ │ ├── scriptSpec.js │ │ ├── ngInitSpec.js │ │ ├── ngNonBindableSpec.js │ │ └── ngCloakSpec.js │ ├── documentSpec.js │ ├── exceptionHandlerSpec.js │ ├── filterSpec.js │ └── forceReflowSpec.js ├── stringifySpec.js ├── ngCookies │ └── cookieStoreSpec.js └── ngSanitize │ └── directive │ └── ngBindHtmlSpec.js ├── .jshintignore ├── src ├── module.suffix ├── publishExternalApis.js ├── ng │ ├── directive │ │ ├── style.js │ │ ├── directives.js │ │ ├── a.js │ │ └── ngNonBindable.js │ ├── locale.js │ ├── rootElement.js │ ├── forceReflow.js │ ├── raf.js │ └── document.js ├── angular.suffix ├── ngCookies │ └── .jshintrc ├── ngResource │ └── .jshintrc ├── ngTouch │ ├── .jshintrc │ └── touch.js ├── ngRoute │ ├── .jshintrc │ └── routeParams.js ├── ngAnimate │ ├── body.js │ ├── animateChildrenDirective.js │ └── rafScheduler.js ├── ngSanitize │ └── .jshintrc ├── ngMock │ └── .jshintrc ├── module.prefix ├── angular.prefix ├── ngMessageFormat │ └── .jshintrc ├── ngScenario │ ├── angular.prefix │ ├── output │ │ ├── Object.js │ │ └── Json.js │ ├── .jshintrc │ ├── angular.suffix │ └── matchers.js ├── loader.prefix ├── ngLocale │ └── .jshintrc ├── angular.bind.js ├── loader.suffix └── stringify.js ├── images ├── favicon.ico ├── css │ ├── arrow_left.gif │ ├── arrow_right.gif │ └── indicator-wait.png ├── docs │ ├── Diagrams.graffle │ │ ├── image1.png │ │ ├── image2.png │ │ ├── image4.png │ │ ├── image8.png │ │ ├── image9.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ ├── guide │ │ ├── concepts.graffle │ │ │ ├── image1.png │ │ │ ├── image4.png │ │ │ └── image5.png │ │ └── simple_scope.graffle │ │ │ ├── image7.png │ │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ └── tutorial │ │ ├── simple_scope.graffle │ │ ├── image7.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── tutorial_02.graffle │ │ ├── image11.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── tutorial_03.graffle │ │ ├── image13.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── tutorial_04.graffle │ │ ├── image15.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── tutorial_07.graffle │ │ ├── image9.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── tutorial_08-09.graffle │ │ ├── image10.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── tutorial_10-11.graffle │ │ ├── image10.png │ │ └── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ └── tutorial_proto.graffle │ │ ├── image7.png │ │ └── QuickLook │ │ ├── Preview.pdf │ │ └── Thumbnail.tiff └── logo │ ├── AngularJS.graffle │ ├── data.plist │ ├── image1.png │ └── image2.png │ ├── AngularJS.exports │ ├── AngularJS.eps │ ├── AngularJS.pdf │ ├── AngularJS-huge.png │ ├── AngularJS-large.png │ ├── AngularJS-medium.png │ └── AngularJS-small.png │ └── AngularJS-Shield.exports │ ├── AngularJS-Shield.pdf │ ├── AngularJS-Shield-huge.png │ ├── AngularJS-Shield-large.png │ ├── AngularJS-Shield-small.png │ └── AngularJS-Shield-medium.png ├── .jshintrc ├── benchmarks ├── largetable-bp │ ├── jquery-noop.js │ └── bp.conf.js ├── event-delegation-bp │ ├── bp.conf.js │ └── app.js ├── ng-options-bp │ ├── bp.conf.js │ └── main.html ├── parsed-expressions-bp │ └── bp.conf.js ├── orderby-bp │ ├── bp.conf.js │ └── app.js └── README.md ├── check-size.sh ├── i18n ├── run-tests.sh ├── generate.sh ├── src │ └── util.js ├── e2e │ ├── runner.html │ ├── localeTest_cs.html │ ├── localeTest_de.html │ ├── localeTest_es.html │ └── localeTest_sk.html ├── README.md ├── spec │ └── utilSpec.js └── update-closure.sh ├── lib ├── browserstack │ ├── start_tunnel.sh │ └── start_tunnel.js └── promises-aplus │ └── promises-aplus-test-adapter.js ├── .gitattributes ├── scripts ├── travis │ ├── npm-bundle-deps.sh │ ├── print_logs.sh │ ├── start_browser_provider.sh │ ├── wait_for_browser_provider.sh │ └── build.sh ├── bower │ ├── repos.inc │ └── unpublish.sh ├── npm │ ├── install-dependencies.sh │ └── clean-shrinkwrap.js ├── jenkins │ ├── master.sh │ └── undo-release.sh ├── angular.js │ ├── tag-release.sh │ └── untag-release.sh └── code.angularjs.org │ └── unpublish.sh ├── bower.json ├── protractor-conf.js ├── css └── angular.css ├── .editorconfig ├── .jshintrc-base ├── .gitignore ├── karma-modules.conf.js ├── karma-docs.conf.js ├── karma-jqlite.conf.js ├── karma-jquery.conf.js ├── init-repo.sh ├── protractor-shared-conf.js ├── README.closure.md ├── protractor-jenkins-conf.js ├── LICENSE └── jenkins_build.sh /docs/content/notes/empty.tmp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/app/assets/css/animations.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/e2e/tools/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true 3 | } -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules/** 2 | lib/htmlparser/** 3 | -------------------------------------------------------------------------------- /src/module.suffix: -------------------------------------------------------------------------------- 1 | 2 | })(window, window.angular); 3 | -------------------------------------------------------------------------------- /docs/config/templates/json-doc.template.json: -------------------------------------------------------------------------------- 1 | {$ doc.data | json $} -------------------------------------------------------------------------------- /src/publishExternalApis.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | publishExternalAPI(angular); 4 | -------------------------------------------------------------------------------- /docs/config/templates/tutorial.template.html: -------------------------------------------------------------------------------- 1 | {% include 'overview.template.html' %} 2 | -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/favicon.ico -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ".jshintrc-base", 3 | "node": true, 4 | "globals": {} 5 | } 6 | -------------------------------------------------------------------------------- /docs/img/helloworld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/helloworld.png -------------------------------------------------------------------------------- /images/css/arrow_left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/css/arrow_left.gif -------------------------------------------------------------------------------- /benchmarks/largetable-bp/jquery-noop.js: -------------------------------------------------------------------------------- 1 | //Override me with ?jquery=/bower_components/jquery/dist/jquery.js 2 | -------------------------------------------------------------------------------- /docs/app/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/app/assets/favicon.ico -------------------------------------------------------------------------------- /docs/img/angular_parts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/angular_parts.png -------------------------------------------------------------------------------- /docs/img/form_data_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/form_data_flow.png -------------------------------------------------------------------------------- /docs/img/helloworld_2way.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/helloworld_2way.png -------------------------------------------------------------------------------- /images/css/arrow_right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/css/arrow_right.gif -------------------------------------------------------------------------------- /docs/app/assets/img/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/app/assets/img/bullet.png -------------------------------------------------------------------------------- /images/css/indicator-wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/css/indicator-wait.png -------------------------------------------------------------------------------- /test/e2e/tools/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | middleware: require('./middleware') 5 | }; 6 | -------------------------------------------------------------------------------- /docs/img/One_Way_Data_Binding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/One_Way_Data_Binding.png -------------------------------------------------------------------------------- /docs/img/Two_Way_Data_Binding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/Two_Way_Data_Binding.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-scope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-scope.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-view.png -------------------------------------------------------------------------------- /docs/img/guide/forms-debounce.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/forms-debounce.gif -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_00.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_02.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_03.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_04.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_05.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-runtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-runtime.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-startup.png -------------------------------------------------------------------------------- /docs/img/guide/dom_scope_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/dom_scope_final.png -------------------------------------------------------------------------------- /docs/img/guide/scenario_runner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/scenario_runner.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_05.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_05.pptx -------------------------------------------------------------------------------- /docs/img/guide/concepts-directive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-directive.png -------------------------------------------------------------------------------- /docs/img/guide/di_sequence_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/di_sequence_final.png -------------------------------------------------------------------------------- /docs/img/guide/simple_scope_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/simple_scope_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/catalog_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/catalog_screen.png -------------------------------------------------------------------------------- /docs/app/assets/img/AngularJS-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/app/assets/img/AngularJS-small.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-databinding1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-databinding1.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-databinding2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-databinding2.png -------------------------------------------------------------------------------- /docs/img/guide/forms-update-on-blur.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/forms-update-on-blur.gif -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_00_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_00_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_07_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_07_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/xhr_service_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/xhr_service_final.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/Diagrams.graffle/image1.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/Diagrams.graffle/image2.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/Diagrams.graffle/image4.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/Diagrams.graffle/image8.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/Diagrams.graffle/image9.png -------------------------------------------------------------------------------- /images/logo/AngularJS.graffle/data.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.graffle/data.plist -------------------------------------------------------------------------------- /images/logo/AngularJS.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.graffle/image1.png -------------------------------------------------------------------------------- /images/logo/AngularJS.graffle/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.graffle/image2.png -------------------------------------------------------------------------------- /src/ng/directive/style.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var styleDirective = valueFn({ 4 | restrict: 'E', 5 | terminal: false 6 | }); 7 | -------------------------------------------------------------------------------- /docs/img/guide/concepts-module-injector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-module-injector.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-module-service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-module-service.png -------------------------------------------------------------------------------- /docs/img/guide/hashbang_vs_regular_url.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/hashbang_vs_regular_url.jpg -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_08-09_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_08-09_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_10-11_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/tutorial/tutorial_10-11_final.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.exports/AngularJS.eps -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.exports/AngularJS.pdf -------------------------------------------------------------------------------- /src/angular.suffix: -------------------------------------------------------------------------------- 1 | jqLite(document).ready(function() { 2 | angularInit(document, bootstrap); 3 | }); 4 | 5 | })(window, document); 6 | -------------------------------------------------------------------------------- /check-size.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | grunt minify 4 | gzip -c < build/angular.min.js > build/angular.min.js.gzip 5 | ls -l build/angular.min.* 6 | -------------------------------------------------------------------------------- /docs/app/assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/app/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /i18n/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | PARENT_DIR="$(dirname "$0")" 5 | 6 | ../node_modules/.bin/jasmine-node "$PARENT_DIR"/spec/ 7 | -------------------------------------------------------------------------------- /images/docs/guide/concepts.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/guide/concepts.graffle/image1.png -------------------------------------------------------------------------------- /images/docs/guide/concepts.graffle/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/guide/concepts.graffle/image4.png -------------------------------------------------------------------------------- /images/docs/guide/concepts.graffle/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/guide/concepts.graffle/image5.png -------------------------------------------------------------------------------- /src/ngCookies/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false 6 | } 7 | } -------------------------------------------------------------------------------- /src/ngResource/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false 6 | } 7 | } -------------------------------------------------------------------------------- /test/jquery_alias.js: -------------------------------------------------------------------------------- 1 | /* global _jQuery: true, _jqLiteMode: true */ 2 | 'use strict'; 3 | 4 | var _jQuery = jQuery, 5 | _jqLiteMode = false; 6 | -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-huge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.exports/AngularJS-huge.png -------------------------------------------------------------------------------- /docs/app/assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/app/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-scope-watch-strategies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/docs/img/guide/concepts-scope-watch-strategies.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/Diagrams.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/guide/simple_scope.graffle/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/guide/simple_scope.graffle/image7.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.exports/AngularJS-large.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.exports/AngularJS-medium.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS.exports/AngularJS-small.png -------------------------------------------------------------------------------- /lib/browserstack/start_tunnel.sh: -------------------------------------------------------------------------------- 1 | export BROWSER_STACK_ACCESS_KEY=`echo $BROWSER_STACK_ACCESS_KEY | rev` 2 | 3 | node ./lib/browserstack/start_tunnel.js & 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # JS files must always use LF for tools to work 5 | *.js eol=lf 6 | -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/Diagrams.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/simple_scope.graffle/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/simple_scope.graffle/image7.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_02.graffle/image11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_02.graffle/image11.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_03.graffle/image13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_03.graffle/image13.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_04.graffle/image15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_04.graffle/image15.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_07.graffle/image9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_07.graffle/image9.png -------------------------------------------------------------------------------- /test/e2e/fixtures/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "browser": true, 3 | "globals": { 4 | "angular": false, 5 | "jQuery": false, 6 | "$": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/e2e/fixtures/sample/script.js: -------------------------------------------------------------------------------- 1 | angular.module("test", []). 2 | controller("TestCtrl", function($scope) { 3 | $scope.text = "Hello, world!"; 4 | }); 5 | -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_08-09.graffle/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_08-09.graffle/image10.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_10-11.graffle/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_10-11.graffle/image10.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_proto.graffle/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_proto.graffle/image7.png -------------------------------------------------------------------------------- /test/jquery_remove.js: -------------------------------------------------------------------------------- 1 | /* global _jQuery: true, _jqLiteMode: true */ 2 | 'use strict'; 3 | 4 | var _jQuery = jQuery.noConflict(true), 5 | _jqLiteMode = true; 6 | -------------------------------------------------------------------------------- /docs/config/tag-defs/sortOrder.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'sortOrder', 3 | transforms: function(doc, tag, value) { 4 | return parseInt(value, 10); 5 | } 6 | }; -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS-Shield.exports/AngularJS-Shield.pdf -------------------------------------------------------------------------------- /src/ngTouch/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false, 6 | "ngTouch": false 7 | } 8 | } -------------------------------------------------------------------------------- /docs/config/templates/pages-data.template.js: -------------------------------------------------------------------------------- 1 | // Meta data used by the AngularJS docs app 2 | angular.module('pagesData', []) 3 | .value('NG_PAGES', {$ doc.pages | json $}); 4 | -------------------------------------------------------------------------------- /images/docs/guide/simple_scope.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/guide/simple_scope.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /src/ngRoute/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false, 6 | "ngRouteModule": false 7 | } 8 | } -------------------------------------------------------------------------------- /docs/config/templates/nav-data.template.js: -------------------------------------------------------------------------------- 1 | // Meta data used by the AngularJS docs app 2 | angular.module('navData', []) 3 | .value('NG_NAVIGATION', {$ doc.areas | json $}); 4 | -------------------------------------------------------------------------------- /i18n/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | BASE_DIR=`dirname $0` 6 | cd $BASE_DIR 7 | 8 | ./run-tests.sh 9 | 10 | node src/closureSlurper.js 11 | 12 | 13 | -------------------------------------------------------------------------------- /images/docs/guide/simple_scope.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/guide/simple_scope.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/simple_scope.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/simple_scope.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_02.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_02.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_03.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_03.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_04.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_04.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_07.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_07.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-huge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS-Shield.exports/AngularJS-Shield-huge.png -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS-Shield.exports/AngularJS-Shield-large.png -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS-Shield.exports/AngularJS-Shield-small.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_02.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_02.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_03.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_03.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_04.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_04.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_07.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_07.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_proto.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_proto.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/logo/AngularJS-Shield.exports/AngularJS-Shield-medium.png -------------------------------------------------------------------------------- /src/ngAnimate/body.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function $$BodyProvider() { 4 | this.$get = ['$document', function($document) { 5 | return jqLite($document[0].body); 6 | }]; 7 | } 8 | -------------------------------------------------------------------------------- /src/ngSanitize/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false, 6 | "htmlSanitizeWriter": false 7 | } 8 | } -------------------------------------------------------------------------------- /test/e2e/fixtures/ngJq/script.js: -------------------------------------------------------------------------------- 1 | angular.module('test', []) 2 | .run(function($rootScope) { 3 | $rootScope.jqueryVersion = window.angular.element().jquery || 'jqLite'; 4 | }); 5 | -------------------------------------------------------------------------------- /test/ngScenario/e2e/style.css: -------------------------------------------------------------------------------- 1 | th { 2 | text-align: left; 3 | } 4 | 5 | tr { 6 | border: 1px solid black; 7 | } 8 | 9 | .redbox { 10 | background-color: red; 11 | } 12 | -------------------------------------------------------------------------------- /images/docs/tutorial/simple_scope.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/simple_scope.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_proto.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/angular.js/HEAD/images/docs/tutorial/tutorial_proto.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /src/ngMock/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false, 6 | "expect": false, 7 | "jQuery": false 8 | } 9 | } -------------------------------------------------------------------------------- /test/e2e/fixtures/ngJqJquery/script.js: -------------------------------------------------------------------------------- 1 | angular.module('test', []) 2 | .run(function($rootScope) { 3 | $rootScope.jqueryVersion = window.angular.element().jquery || 'jqLite'; 4 | }); 5 | -------------------------------------------------------------------------------- /src/module.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2015 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window, angular, undefined) { 7 | -------------------------------------------------------------------------------- /src/angular.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2015 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window, document, undefined) { 7 | -------------------------------------------------------------------------------- /src/ngMessageFormat/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false, 6 | "goog": false // see src/module_closure.prefix 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/badexpr.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:badexpr 3 | @fullName Expecting end operator 4 | @description 5 | 6 | The Angular expression is missing the corresponding closing operator. 7 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/untermstr.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:untermstr 3 | @fullName Unterminated string literal 4 | @description 5 | 6 | The string literal was not terminated in your Angular expression. 7 | -------------------------------------------------------------------------------- /test/e2e/tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "globals": { 4 | "describe": false, 5 | "ddescribe": false, 6 | "xdescribe": false, 7 | "it": false, 8 | "xit": false, 9 | "iit": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/config/templates/versions-data.template.js: -------------------------------------------------------------------------------- 1 | // Meta data used by the AngularJS docs app 2 | angular.module('versionsData', []) 3 | .value('NG_VERSION', {$ doc.currentVersion | json $}) 4 | .value('NG_VERSIONS', {$ doc.versions | json $}); 5 | -------------------------------------------------------------------------------- /docs/content/error/$animate/notcsel.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $animate:notcsel 3 | @fullName Not class CSS selector 4 | @description 5 | 6 | Expecting a CSS selector for class. Class selectors must start with `.`, for example: `.my-class-name`. 7 | -------------------------------------------------------------------------------- /src/ngScenario/angular.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2015 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window, document){ 7 | var _jQuery = window.jQuery.noConflict(true); 8 | -------------------------------------------------------------------------------- /benchmarks/event-delegation-bp/bp.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | scripts: [{ 4 | id: 'angular', 5 | src: '/build/angular.js' 6 | },{ 7 | src: 'app.js', 8 | }] 9 | }); 10 | }; 11 | -------------------------------------------------------------------------------- /docs/content/error/ng/cpta.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ng:cpta 3 | @fullName Copying TypedArray 4 | @description 5 | 6 | Copying TypedArray's with a destination is not supported because TypedArray 7 | objects can not be mutated, they are fixed length. 8 | -------------------------------------------------------------------------------- /src/loader.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2015 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | 'use strict'; 7 | (function() { 8 | function isFunction(value) {return typeof value === 'function';}; -------------------------------------------------------------------------------- /test/e2e/fixtures/sample/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

{{text}}

5 |
6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /benchmarks/ng-options-bp/bp.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | scripts: [ { 4 | id: 'angular', 5 | src: '/build/angular.js' 6 | }, 7 | { 8 | src: 'app.js', 9 | }] 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/reqendinterp.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:reqendinterp 3 | @fullName Unterminated interpolation 4 | @description 5 | 6 | The interpolation text does not have an ending `endSymbol` ("}}" by default) and is unterminated. 7 | -------------------------------------------------------------------------------- /src/ngScenario/output/Object.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Creates a global value $result with the result of the runner. 5 | */ 6 | angular.scenario.output('object', function(context, runner, model) { 7 | runner.$window.$result = model.value; 8 | }); 9 | -------------------------------------------------------------------------------- /benchmarks/parsed-expressions-bp/bp.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | scripts: [ { 4 | id: 'angular', 5 | src: '/build/angular.js' 6 | }, 7 | { 8 | src: 'app.js', 9 | }] 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /docs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AngularJS-docs-app", 3 | "dependencies": { 4 | "jquery": "2.1.1", 5 | "lunr.js": "0.4.3", 6 | "open-sans-fontface": "1.0.4", 7 | "google-code-prettify": "1.0.1", 8 | "bootstrap": "3.1.1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /scripts/travis/npm-bundle-deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # normalize the working dir to the directory of the script 6 | cd $(dirname $0); 7 | 8 | cd ../.. 9 | curl "http://23.251.148.50:8000/tar/$TRAVIS_REPO_SLUG/$TRAVIS_COMMIT" | tar xz || true 10 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/interr.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:interr 3 | @fullName Interpolation Error 4 | @description 5 | 6 | This error occurs when interpolation fails due to some exception. The error 7 | message above should provide additional context. 8 | -------------------------------------------------------------------------------- /docs/protractor-conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var config = require('../protractor-shared-conf').config; 4 | 5 | config.specs = [ 6 | 'app/e2e/**/*.scenario.js' 7 | ]; 8 | 9 | config.capabilities = { 10 | browserName: 'chrome', 11 | }; 12 | 13 | exports.config = config; 14 | -------------------------------------------------------------------------------- /i18n/src/util.js: -------------------------------------------------------------------------------- 1 | exports.findLocaleId = function findLocaleId(str, type) { 2 | if (type === 'num') { 3 | return (str.match(/^NumberFormatSymbols_(.+)$/) || [])[1]; 4 | } else if (type == 'datetime') { 5 | return (str.match(/^DateTimeSymbols_(.+)$/) || [])[1]; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/ngAnimate/bodySpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$$body', function() { 4 | beforeEach(module('ngAnimate')); 5 | 6 | it("should inject $document", inject(function($$body, $document) { 7 | expect($$body).toEqual(jqLite($document[0].body)); 8 | })); 9 | }); 10 | -------------------------------------------------------------------------------- /docs/config/services/errorNamespaceMap.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var StringMap = require('stringmap'); 3 | 4 | /** 5 | * @dgService errorNamespaceMap 6 | * A map of error namespaces by name. 7 | */ 8 | module.exports = function errorNamespaceMap() { 9 | return new StringMap(); 10 | }; -------------------------------------------------------------------------------- /src/ng/directive/directives.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function ngDirective(directive) { 4 | if (isFunction(directive)) { 5 | directive = { 6 | link: directive 7 | }; 8 | } 9 | directive.restrict = directive.restrict || 'AC'; 10 | return valueFn(directive); 11 | } 12 | -------------------------------------------------------------------------------- /docs/content/error/$sce/itype.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $sce:itype 3 | @fullName String Value is Required for SCE Trust Call 4 | @description 5 | 6 | {@link ng.$sce#trustAs $sce.trustAs} requires a string value. 7 | 8 | Read more about {@link ng.$sce Strict Contextual Escaping (SCE)} in AngularJS. 9 | -------------------------------------------------------------------------------- /docs/content/error/jqLite/offargs.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name jqLite:offargs 3 | @fullName Invalid jqLite#off() parameter 4 | @description 5 | 6 | This error occurs when trying to pass too many arguments to `jqLite#off`. Note 7 | that `jqLite#off` does not support namespaces or selectors like jQuery. 8 | -------------------------------------------------------------------------------- /src/ngScenario/output/Json.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Generates JSON output into a context. 5 | */ 6 | angular.scenario.output('json', function(context, runner, model) { 7 | model.on('RunnerEnd', function() { 8 | context.text(angular.toJson(model.value)); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AngularJS", 3 | "devDependencies": { 4 | "jquery": "2.1.1", 5 | "closure-compiler": "https://dl.google.com/closure-compiler/compiler-20140814.zip", 6 | "ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.3/assets/ng-closure-runner.zip" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/content/error/$compile/baddir.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:baddir 3 | @fullName Invalid Directive Name 4 | @description 5 | 6 | This error occurs when the name of a directive is not valid. 7 | 8 | Directives must start with a lowercase character and must not contain leading or trailing whitespaces. 9 | -------------------------------------------------------------------------------- /docs/content/error/jqLite/onargs.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name jqLite:onargs 3 | @fullName Invalid jqLite#on() Parameters 4 | @description 5 | 6 | This error occurs when trying to pass too many arguments to `jqLite#on`. Note 7 | that `jqLite#on` does not support the `selector` or `eventData` parameters as 8 | jQuery does. 9 | -------------------------------------------------------------------------------- /benchmarks/orderby-bp/bp.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | scripts: [ 4 | { 5 | "id": "jquery", 6 | "src": "jquery-noop.js" 7 | },{ 8 | id: 'angular', 9 | src: '/build/angular.js' 10 | },{ 11 | src: 'app.js', 12 | }] 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /docs/content/misc/index.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Miscellaneous 3 | @description 4 | 5 | # Miscellaneous Links 6 | 7 | - {@link misc/started Getting Started} 8 | - {@link misc/downloading Downloading AngularJS} 9 | - {@link misc/faq Frequently Asked Questions} 10 | - {@link misc/contribute Building AngularJS} 11 | -------------------------------------------------------------------------------- /docs/config/tag-defs/tutorial-step.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'step', 3 | transforms: function(doc, tag, value) { 4 | if ( doc.docType !== 'tutorial' ) { 5 | throw new Error('Invalid tag, step. You should only use this tag on tutorial docs'); 6 | } 7 | return parseInt(value,10); 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /benchmarks/largetable-bp/bp.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | scripts: [{ 4 | id: 'jquery', 5 | src: 'jquery-noop.js' 6 | }, 7 | { 8 | id: 'angular', 9 | src: '/build/angular.js' 10 | }, 11 | { 12 | src: 'app.js', 13 | }] 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /src/ngLocale/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "bitwise": false, /* locale files use bitwise operators */ 4 | "maxlen": false, /* locale files are generated from a 3rd party library that has long lines */ 5 | "browser": true, 6 | "globals": { 7 | "angular": false 8 | }, 9 | "-W041": false 10 | } -------------------------------------------------------------------------------- /docs/content/error/$sce/icontext.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $sce:icontext 3 | @fullName Invalid / Unknown SCE context 4 | @description 5 | 6 | The context enum passed to {@link ng.$sce#trustAs $sce.trustAs} was not recognized. 7 | 8 | Please consult the list of {@link ng.$sce#contexts supported Strict Contextual Escaping (SCE) contexts}. 9 | -------------------------------------------------------------------------------- /test/e2e/fixtures/ngJq/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{jqueryVersion}} 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/content/error/ng/areq.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ng:areq 3 | @fullName Bad Argument 4 | @description 5 | 6 | AngularJS often asserts that certain values will be present and truthy using a 7 | helper function. If the assertion fails, this error is thrown. To fix this problem, 8 | make sure that the value the assertion expects is defined and truthy. 9 | -------------------------------------------------------------------------------- /protractor-conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var config = require('./protractor-shared-conf').config; 4 | 5 | config.specs = [ 6 | 'test/e2e/tests/**/*.js', 7 | 'build/docs/ptore2e/**/*.js', 8 | 'docs/app/e2e/**/*.scenario.js' 9 | ]; 10 | 11 | config.capabilities = { 12 | browserName: 'chrome', 13 | }; 14 | 15 | exports.config = config; 16 | -------------------------------------------------------------------------------- /src/angular.bind.js: -------------------------------------------------------------------------------- 1 | if (window.angular.bootstrap) { 2 | //AngularJS is already loaded, so we can return here... 3 | console.log('WARNING: Tried to load angular more than once.'); 4 | return; 5 | } 6 | 7 | //try to bind to jquery now so that one can write jqLite(document).ready() 8 | //but we will rebind on bootstrap again. 9 | bindJQuery(); 10 | 11 | -------------------------------------------------------------------------------- /src/ng/locale.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc service 5 | * @name $locale 6 | * 7 | * @description 8 | * $locale service provides localization rules for various Angular components. As of right now the 9 | * only public api is: 10 | * 11 | * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) 12 | */ 13 | 14 | -------------------------------------------------------------------------------- /test/e2e/tests/sampleSpec.js: -------------------------------------------------------------------------------- 1 | // Sample E2E test: 2 | // 3 | describe('Sample', function() { 4 | beforeEach(function() { 5 | loadFixture("sample").andWaitForAngular(); 6 | }); 7 | 8 | it('should have the interpolated text', function() { 9 | expect(element(by.binding('text')).getText()) 10 | .toBe('Hello, world!'); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /test/ng/windowSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$window', function() { 4 | it("should inject $window", inject(function($window) { 5 | expect($window).toBe(window); 6 | })); 7 | 8 | it('should be able to mock $window without errors', function() { 9 | module({$window: {}}); 10 | inject(['$sce', angular.noop]); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /scripts/travis/print_logs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LOG_FILES=$LOGS_DIR/* 4 | 5 | for FILE in $LOG_FILES; do 6 | echo -e "\n\n\n" 7 | echo "================================================================================" 8 | echo " $FILE" 9 | echo "================================================================================" 10 | cat $FILE 11 | done 12 | -------------------------------------------------------------------------------- /css/angular.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 4 | .ng-cloak, .x-ng-cloak, 5 | .ng-hide:not(.ng-hide-animate) { 6 | display: none !important; 7 | } 8 | 9 | ng\:form { 10 | display: block; 11 | } 12 | 13 | .ng-animate-shim { 14 | visibility:hidden; 15 | } 16 | 17 | .ng-anchor { 18 | position:absolute; 19 | } 20 | -------------------------------------------------------------------------------- /docs/content/error/$cacheFactory/iid.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $cacheFactory:iid 3 | @fullName Invalid ID 4 | @description 5 | 6 | This error occurs when trying to create a new `cache` object via {@link ng.$cacheFactory} with an ID that was already used to create another cache object. 7 | 8 | To resolve the error please use a different cache ID when calling `$cacheFactory`. 9 | -------------------------------------------------------------------------------- /docs/content/error/ng/badname.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ng:badname 3 | @fullName Bad `hasOwnProperty` Name 4 | @description 5 | 6 | Occurs when you try to use the name `hasOwnProperty` in a context where it is not allowed. 7 | Generally, a name cannot be `hasOwnProperty` because it is used, internally, on a object 8 | and allowing such a name would break lookups on this object. 9 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/wantstring.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:wantstring 3 | @fullName Expected the beginning of a string 4 | @description 5 | 6 | We expected to see the beginning of a string (either a single quote or a double 7 | quote character) in the expression but it was not found. The expression is 8 | invalid. If this is incorrect, please file an issue on github. 9 | -------------------------------------------------------------------------------- /test/ng/rootElementSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$rootElement', function() { 4 | it('should publish the bootstrap element into $rootElement', function() { 5 | var element = jqLite('
'); 6 | var injector = angular.bootstrap(element); 7 | 8 | expect(injector.get('$rootElement')[0]).toBe(element[0]); 9 | 10 | dealoc(element); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [dropdown-toggle.js] 14 | trim_trailing_whitespace = false 15 | insert_final_newline = false 16 | 17 | [htmlparser.js] 18 | insert_final_newline = false 19 | -------------------------------------------------------------------------------- /docs/content/error/ngPattern/noregexp.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngPattern:noregexp 3 | @fullName Expected Regular Expression 4 | @description 5 | This error occurs when 'ngPattern' is passed an expression that isn't a regular expression or doesn't have the expected format. 6 | 7 | For more information on valid expression syntax, see 'ngPattern' in {@link ng.directive:input input} directive docs. 8 | -------------------------------------------------------------------------------- /test/ngAnimate/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.jshintrc", 3 | "browser": true, 4 | "newcap": false, 5 | "globals": { 6 | "mergeAnimationOptions": false, 7 | "prepareAnimationOptions": false, 8 | "applyAnimationStyles": false, 9 | "applyAnimationFromStyles": false, 10 | "applyAnimationToStyles": false, 11 | "applyAnimationClassesFactory": false 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/content/error/$resource/badname.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $resource:badname 3 | @fullName Cannot use hasOwnProperty as a parameter name 4 | @description 5 | 6 | Occurs when you try to use the name `hasOwnProperty` as a name of a parameter. 7 | Generally, a name cannot be `hasOwnProperty` because it is used, internally, on a object 8 | and allowing such a name would break lookups on this object. 9 | -------------------------------------------------------------------------------- /.jshintrc-base: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "immed": true, 4 | "newcap": true, 5 | "noarg": true, 6 | "noempty": true, 7 | "nonew": true, 8 | "trailing": true, 9 | "maxlen": 200, 10 | "boss": true, 11 | "eqnull": true, 12 | "expr": true, 13 | "globalstrict": true, 14 | "laxbreak": true, 15 | "loopfunc": true, 16 | "sub": true, 17 | "undef": true, 18 | "indent": 2 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /benchpress-build/ 3 | .DS_Store 4 | gen_docs.disable 5 | test.disable 6 | regression/temp*.html 7 | performance/temp*.html 8 | .idea/workspace.xml 9 | *~ 10 | *.swp 11 | angular.js.tmproj 12 | /node_modules/ 13 | bower_components/ 14 | angular.xcodeproj 15 | .idea 16 | *.iml 17 | .agignore 18 | .lvimrc 19 | libpeerconnection.log 20 | npm-debug.log 21 | /tmp/ 22 | /scripts/bower/bower-* 23 | -------------------------------------------------------------------------------- /scripts/bower/repos.inc: -------------------------------------------------------------------------------- 1 | #!/bin/false 2 | # -*- mode: sh; -*- vim: set filetype=sh: 3 | 4 | REPOS=( 5 | angular 6 | angular-animate 7 | angular-aria 8 | angular-cookies 9 | angular-i18n 10 | angular-loader 11 | angular-message-format 12 | angular-messages 13 | angular-mocks 14 | angular-resource 15 | angular-route 16 | angular-sanitize 17 | angular-scenario 18 | angular-touch 19 | ) 20 | -------------------------------------------------------------------------------- /docs/content/error/ng/test.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ng:test 3 | @fullName Testability Not Found 4 | @description 5 | 6 | Angular's testability helper, getTestability, requires a root element to be 7 | passed in. This helps differentiate between different Angular apps on the same 8 | page. This error is thrown when no injector is found for root element. It is 9 | often because the root element is outside of the ng-app. 10 | -------------------------------------------------------------------------------- /benchmarks/ng-options-bp/main.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

5 | Tests the execution of ng-options for rendering during model and option updates. 6 |

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /docs/content/error/$sce/imatcher.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $sce:imatcher 3 | @fullName Invalid matcher (only string patterns and RegExp instances are supported) 4 | @description 5 | 6 | Please see {@link $sceDelegateProvider#resourceUrlWhitelist 7 | $sceDelegateProvider.resourceUrlWhitelist} and {@link 8 | $sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} for the 9 | list of acceptable items. 10 | -------------------------------------------------------------------------------- /docs/content/error/$parse/isecobj.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:isecobj 3 | @fullName Referencing Object Disallowed 4 | @description 5 | 6 | Occurs when an expression attempts to access the 'Object' object (Root object in JavaScript). 7 | 8 | Angular bans access to Object from within expressions since access is a known way to modify 9 | the behaviour of existing objects. 10 | 11 | To resolve this error, avoid Object access. 12 | -------------------------------------------------------------------------------- /docs/content/error/$parse/lexerr.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:lexerr 3 | @fullName Lexer Error 4 | @description 5 | 6 | Occurs when an expression has a lexical error, for example a malformed number (0.5e-) or an invalid unicode escape. 7 | 8 | The error message contains a more precise error. 9 | 10 | To resolve, learn more about {@link guide/expression Angular expressions}, identify the error and fix the expression's syntax. 11 | -------------------------------------------------------------------------------- /docs/content/error/$parse/ueoe.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:ueoe 3 | @fullName Unexpected End of Expression 4 | @description 5 | 6 | Occurs when an expression is missing tokens at the end of the expression. 7 | For example, forgetting a closing bracket in an expression will trigger this error. 8 | 9 | To resolve, learn more about {@link guide/expression Angular expressions}, identify the error and fix the expression's syntax. 10 | -------------------------------------------------------------------------------- /docs/app/assets/Error404.html: -------------------------------------------------------------------------------- 1 |

Oops!

2 | 3 |

The page you requested does not exist. Perhaps you were looking for something else...

4 | 5 |
6 | 7 |
8 |
{{ key }}
9 |
{{ item.name }}
10 |
11 |
12 | -------------------------------------------------------------------------------- /docs/content/error/$parse/isecfn.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:isecfn 3 | @fullName Referencing Function Disallowed 4 | @description 5 | 6 | Occurs when an expression attempts to access the 'Function' object (constructor for all functions in JavaScript). 7 | 8 | Angular bans access to Function from within expressions since constructor access is a known way to execute arbitrary Javascript code. 9 | 10 | To resolve this error, avoid Function access. 11 | -------------------------------------------------------------------------------- /docs/content/error/$resource/badargs.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $resource:badargs 3 | @fullName Too Many Arguments 4 | @description 5 | 6 | This error occurs when specifying too many arguments to a {@link ngResource.$resource `$resource`} action, such as `get`, `query` or any user-defined custom action. 7 | These actions may take up to 4 arguments. 8 | 9 | For more information, refer to the {@link ngResource.$resource `$resource`} API reference documentation. 10 | -------------------------------------------------------------------------------- /i18n/e2e/runner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <angular/> Docs Scenario Runner 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/ngScenario/e2e/Runner-compiled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/content/error/$location/isrcharg.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $location:isrcharg 3 | @fullName Wrong $location.search() argument type 4 | @description 5 | 6 | To resolve this error, ensure that the first argument for the `$location.search` call is a `string` or an object. 7 | You can use the stack trace associated with this error to identify the call site that caused this issue. 8 | 9 | To learn more, please consult the {@link ng.$location `$location`} api docs. 10 | -------------------------------------------------------------------------------- /docs/content/error/$sce/iwcard.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $sce:iwcard 3 | @fullName The sequence *** is not a valid pattern wildcard 4 | @description 5 | 6 | The strings in {@link $sceDelegateProvider#resourceUrlWhitelist 7 | $sceDelegateProvider.resourceUrlWhitelist} and {@link 8 | $sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} may not 9 | contain the undefined sequence `***`. Only `*` and `**` wildcard patterns are defined. 10 | -------------------------------------------------------------------------------- /scripts/travis/start_browser_provider.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Has to be run from project root directory. 3 | 4 | 5 | if [ "$BROWSER_PROVIDER" == "browserstack" ]; then 6 | echo "Using BrowserStack" 7 | elif [ "$BROWSER_PROVIDER" == "saucelabs" ]; then 8 | echo "Using SauceLabs" 9 | else 10 | echo "Invalid BROWSER_PROVIDER. Please set env var BROWSER_PROVIDER to 'saucelabs' or 'browserstack'." 11 | exit 1 12 | fi 13 | 14 | ./lib/${BROWSER_PROVIDER}/start_tunnel.sh 15 | -------------------------------------------------------------------------------- /docs/content/error/$q/norslvr.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $q:norslvr 3 | @fullName No resolver function passed to $Q 4 | @description 5 | 6 | Occurs when calling creating a promise using {@link $q} as a constructor, without providing the 7 | required `resolver` function. 8 | 9 | ``` 10 | //bad 11 | var promise = $q().then(doSomething); 12 | 13 | //good 14 | var promise = $q(function(resolve, reject) { 15 | waitForSomethingAsync.then(resolve); 16 | }).then(doSomething); 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/content/error/ng/cpi.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ng:cpi 3 | @fullName Bad Copy 4 | @description 5 | 6 | This error occurs when attempting to copy an object to itself. Calling {@link 7 | angular.copy angular.copy} with a `destination` object deletes 8 | all of the elements or properties on `destination` before copying to it. Copying 9 | an object to itself is not supported. Make sure to check your calls to 10 | `angular.copy` and avoid copying objects or arrays to themselves. 11 | -------------------------------------------------------------------------------- /docs/content/error/ngOptions/iexp.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngOptions:iexp 3 | @fullName Invalid Expression 4 | @description 5 | This error occurs when 'ngOptions' is passed an expression that isn't in an expected form. 6 | 7 | Here's an example of correct syntax: 8 | 9 | ``` 10 | ` require the model to be a `Date` object. 7 | If the model is something else, this error will be thrown. 8 | Angular does not set validation errors on the `` in this case 9 | as those errors are shown to the user, but the erroneous state was 10 | caused by incorrect application logic and not by the user. 11 | 12 | -------------------------------------------------------------------------------- /i18n/README.md: -------------------------------------------------------------------------------- 1 | # i18n directory overview: 2 | 3 | - closure/ - closure files we use for ruleset generation 4 | - src/ - source files 5 | - spec/ - spec files for stuff in src directory 6 | - generate.sh - runs src scripts on closure dir and stores output in locale dir 7 | - update-closure.sh - downloads the latest version of closure files from public git repo 8 | 9 | The closure files (maintained by Shanjian Li (shanjian)) change very rarely, so we don't need to 10 | regenerate locale files very often. 11 | 12 | -------------------------------------------------------------------------------- /docs/content/error/$parse/syntax.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:syntax 3 | @fullName Syntax Error 4 | @description 5 | 6 | Occurs when there is a syntax error in an expression. These errors are thrown while compiling the expression. 7 | The error message contains a more precise description of the error, including the location (column) in the expression where the error occurred. 8 | 9 | To resolve, learn more about {@link guide/expression Angular expressions}, identify the error and fix the expression's syntax. 10 | -------------------------------------------------------------------------------- /karma-modules.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var angularFiles = require('./angularFiles'); 4 | var sharedConfig = require('./karma-shared.conf'); 5 | 6 | module.exports = function(config) { 7 | sharedConfig(config, {testName: 'AngularJS: modules', logFile: 'karma-modules.log'}); 8 | 9 | config.set({ 10 | files: angularFiles.mergeFilesFor('karmaModules', 'angularSrcModules'), 11 | 12 | junitReporter: { 13 | outputFile: 'test_out/modules.xml', 14 | suite: 'modules' 15 | } 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /test/e2e/tests/ngJqSpec.js: -------------------------------------------------------------------------------- 1 | describe('Customizing the jqlite / jquery version', function() { 2 | 3 | it('should be able to force jqlite', function() { 4 | loadFixture("ngJq").andWaitForAngular(); 5 | expect(element(by.binding('jqueryVersion')).getText()).toBe('jqLite'); 6 | }); 7 | 8 | it('should be able to use a specific version jQuery', function() { 9 | loadFixture("ngJqJquery").andWaitForAngular(); 10 | expect(element(by.binding('jqueryVersion')).getText()).toBe('2.1.0'); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/dupvalue.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:dupvalue 3 | @fullName Duplicate choice in plural/select 4 | @description 5 | 6 | You have repeated a match selection for your plural or select MessageFormat 7 | extension in your interpolation expression. The different choices have to be unique. 8 | 9 | For more information about the MessageFormat syntax in interpolation 10 | expressions, please refer to MessageFormat extensions section at 11 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 12 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/reqcomma.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:reqcomma 3 | @fullName Missing comma following MessageFormat plural/select keyword 4 | @description 5 | 6 | The MessageFormat syntax requires a comma following the "plural" or "select" 7 | extension keyword in the extended interpolation syntax. 8 | 9 | For more information about the MessageFormat syntax in interpolation 10 | expressions, please refer to MessageFormat extensions section at 11 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 12 | -------------------------------------------------------------------------------- /karma-docs.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var sharedConfig = require('./karma-shared.conf'); 4 | 5 | module.exports = function(config) { 6 | sharedConfig(config, {testName: 'AngularJS: docs', logFile: 'karma-docs.log'}); 7 | 8 | config.set({ 9 | files: [ 10 | 'build/angular.js', 11 | 'build/angular-mocks.js', 12 | 'docs/app/src/**/*.js', 13 | 'docs/app/test/**/*Spec.js' 14 | ], 15 | 16 | junitReporter: { 17 | outputFile: 'test_out/docs.xml', 18 | suite: 'Docs' 19 | } 20 | }); 21 | }; 22 | -------------------------------------------------------------------------------- /scripts/npm/install-dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | SHRINKWRAP_FILE=npm-shrinkwrap.json 6 | SHRINKWRAP_CACHED_FILE=node_modules/npm-shrinkwrap.cached.json 7 | 8 | if diff -q $SHRINKWRAP_FILE $SHRINKWRAP_CACHED_FILE; then 9 | echo 'No shrinkwrap changes detected. npm install will be skipped...'; 10 | else 11 | echo 'Blowing away node_modules and reinstalling npm dependencies...' 12 | rm -rf node_modules 13 | npm install 14 | cp $SHRINKWRAP_FILE $SHRINKWRAP_CACHED_FILE 15 | echo 'npm install successful!' 16 | fi 17 | -------------------------------------------------------------------------------- /docs/config/inline-tag-defs/type.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var encoder = new require('node-html-encoder').Encoder(); 4 | 5 | /** 6 | * @dgService typeInlineTagDef 7 | * @description 8 | * Replace with markup that displays a nice type 9 | */ 10 | module.exports = function typeInlineTagDef(getTypeClass) { 11 | return { 12 | name: 'type', 13 | handler: function(doc, tagName, tagDescription) { 14 | return ''+encoder.htmlEncode(tagDescription) + ''; 15 | } 16 | }; 17 | }; -------------------------------------------------------------------------------- /karma-jqlite.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var angularFiles = require('./angularFiles'); 4 | var sharedConfig = require('./karma-shared.conf'); 5 | 6 | module.exports = function(config) { 7 | sharedConfig(config, {testName: 'AngularJS: jqLite', logFile: 'karma-jqlite.log'}); 8 | 9 | config.set({ 10 | files: angularFiles.mergeFilesFor('karma'), 11 | exclude: angularFiles.mergeFilesFor('karmaExclude'), 12 | 13 | junitReporter: { 14 | outputFile: 'test_out/jqlite.xml', 15 | suite: 'jqLite' 16 | } 17 | }); 18 | }; 19 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/unsafe.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:unsafe 3 | @fullName MessageFormat extensions not allowed in secure context 4 | @description 5 | 6 | You have attempted to use a MessageFormat extension in your interpolation expression that is marked as a secure context. For security purposes, this is not supported. 7 | 8 | Read more about secure contexts at {@link ng.$sce Strict Contextual Escaping 9 | (SCE)} and about the MessageFormat extensions at {@link 10 | guide/i18n#MessageFormat Angular i18n MessageFormat}. 11 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/unknarg.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:unknarg 3 | @fullName Unrecognized MessageFormat extension 4 | @description 5 | 6 | The MessageFormat extensions provided by `ngMessageFormat` are currently 7 | limited to "plural" and "select". The extension that you have used is either 8 | unsupported or invalid. 9 | 10 | For more information about the MessageFormat syntax in interpolation 11 | expressions, please refer to MessageFormat extensions section at 12 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 13 | -------------------------------------------------------------------------------- /docs/content/error/$compile/noctrl.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:noctrl 3 | @fullName Controller is required. 4 | @description 5 | 6 | When using the `bindToController` feature of AngularJS, a directive is required 7 | to have a Controller. A controller may be specified by adding a "controller" 8 | property to the directive definition object. Its value should be either a 9 | string, or an invokable object (a function, or an array whose last element is a 10 | function). 11 | 12 | For more information, see the {@link guide/directive directives guide}. 13 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/noconcat.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:noconcat 3 | @fullName Multiple Expressions 4 | @description 5 | 6 | This error occurs when performing an interpolation that concatenates multiple 7 | expressions when a trusted value is required. Concatenating expressions makes 8 | it hard to reason about whether some combination of concatenated values are 9 | unsafe to use and could easily lead to XSS. 10 | 11 | For more information about how AngularJS helps keep your app secure, refer to 12 | the {@link ng.$sce $sce} API doc. 13 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/reqopenbrace.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:reqopenbrace 3 | @fullName An opening brace was expected but not found 4 | @description 5 | 6 | The plural or select extension keyword or values (such as "other", "male", 7 | "female", "=0", "one", "many", etc.) MUST be followed by a message enclosed in 8 | braces. 9 | 10 | For more information about the MessageFormat syntax in interpolation 11 | expressions, please refer to MessageFormat extensions section at 12 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 13 | -------------------------------------------------------------------------------- /karma-jquery.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var angularFiles = require('./angularFiles'); 4 | var sharedConfig = require('./karma-shared.conf'); 5 | 6 | module.exports = function(config) { 7 | sharedConfig(config, {testName: 'AngularJS: jQuery', logFile: 'karma-jquery.log'}); 8 | 9 | config.set({ 10 | files: angularFiles.mergeFilesFor('karmaJquery'), 11 | exclude: angularFiles.mergeFilesFor('karmaJqueryExclude'), 12 | 13 | junitReporter: { 14 | outputFile: 'test_out/jquery.xml', 15 | suite: 'jQuery' 16 | } 17 | }); 18 | }; 19 | -------------------------------------------------------------------------------- /test/e2e/fixtures/ngJqJquery/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{jqueryVersion}} 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/content/error/$location/ipthprfx.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $location:ipthprfx 3 | @fullName Invalid or Missing Path Prefix 4 | @description 5 | 6 | This error occurs when you configure the {@link ng.$location `$location`} service in the html5 mode, specify a base url for your application via `` element and try to update the location with a path that doesn't match the base prefix. 7 | 8 | To resolve this issue, please check the base url specified via the `` tag in the head of your main html document, as well as the url that you tried to set the location to. 9 | -------------------------------------------------------------------------------- /src/loader.suffix: -------------------------------------------------------------------------------- 1 | setupModuleLoader(window); 2 | })(window); 3 | 4 | /** 5 | * Closure compiler type information 6 | * 7 | * @typedef { { 8 | * requires: !Array., 9 | * invokeQueue: !Array.>, 10 | * 11 | * service: function(string, Function):angular.Module, 12 | * factory: function(string, Function):angular.Module, 13 | * value: function(string, *):angular.Module, 14 | * 15 | * filter: function(string, Function):angular.Module, 16 | * 17 | * init: function(Function):angular.Module 18 | * } } 19 | */ 20 | angular.Module; 21 | 22 | -------------------------------------------------------------------------------- /src/ngAnimate/animateChildrenDirective.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var $$AnimateChildrenDirective = [function() { 4 | return function(scope, element, attrs) { 5 | var val = attrs.ngAnimateChildren; 6 | if (angular.isString(val) && val.length === 0) { //empty attribute 7 | element.data(NG_ANIMATE_CHILDREN_DATA, true); 8 | } else { 9 | attrs.$observe('ngAnimateChildren', function(value) { 10 | value = value === 'on' || value === 'true'; 11 | element.data(NG_ANIMATE_CHILDREN_DATA, value); 12 | }); 13 | } 14 | }; 15 | }]; 16 | -------------------------------------------------------------------------------- /docs/content/error/$location/nostate.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $location:nostate 3 | @fullName History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API 4 | @description 5 | 6 | This error occurs when the {@link ng.$location#state $location.state} method is used when {@link ng.$locationProvider#html5Mode $locationProvider.html5Mode} is not turned on or the browser used doesn't support the HTML5 History API (for example, IE9 or Android 2.3). 7 | 8 | To avoid this error, either drop support for those older browsers or avoid using this method. 9 | -------------------------------------------------------------------------------- /docs/content/error/$sanitize/badparse.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $sanitize:badparse 3 | @fullName Parsing Error while Sanitizing 4 | @description 5 | 6 | This error occurs when the HTML string passed to '$sanitize' can't be parsed by the sanitizer. 7 | The error contains part of the html string that can't be parsed. 8 | 9 | The parser is more strict than a typical browser parser, so it's possible that some obscure input would produce this error despite the string being recognized as valid HTML by a browser. 10 | 11 | If a valid html code results in this error, please file a bug. 12 | -------------------------------------------------------------------------------- /docs/content/error/index.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Error Reference 3 | @description 4 | 5 | # Error Reference 6 | 7 | Use the Error Reference manual to find information about error conditions in 8 | your AngularJS app. Errors thrown in production builds of AngularJS will log 9 | links to this site on the console. 10 | 11 | Other useful references for debugging your app include: 12 | 13 | - {@link api/ API Reference} for detailed information about specific features 14 | - {@link guide/ Developer Guide} for AngularJS concepts 15 | - {@link tutorial/ Tutorial} for getting started 16 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/reqarg.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:reqarg 3 | @fullName Missing required argument for MessageFormat 4 | @description 5 | 6 | You must specify the MessageFormat function that you're using right after the 7 | comma following the Angular expression. Currently, the supported functions are 8 | "plural" and "select" (for gender selections.) 9 | 10 | For more information about the MessageFormat syntax in interpolation 11 | expressions, please refer to MessageFormat extensions section at 12 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 13 | -------------------------------------------------------------------------------- /src/ngScenario/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.jshintrc-base", 3 | "browser": true, 4 | "globals": { 5 | "angular": false, 6 | "includes": false, 7 | "asyncForEach": false, 8 | "msie": false, 9 | "browserTrigger": false, 10 | "console": false, 11 | "alert": false, 12 | "_jQuery": false, 13 | "angularInit": false, 14 | "formatException": false, 15 | "AnimationEvent": false, 16 | "TransitionEvent": false, 17 | "WebKitAnimationEvent": false, 18 | "WebKitTransitionEvent": false, 19 | "$runner": false, 20 | "callerFile": false 21 | } 22 | } -------------------------------------------------------------------------------- /test/e2e/tests/helpers/main.js: -------------------------------------------------------------------------------- 1 | var helper = { 2 | andWaitForAngular: function() { 3 | browser.waitForAngular(); 4 | }, 5 | loadFixture: function(fixture) { 6 | var i = 0; 7 | while (fixture[i] === '/') ++i; 8 | fixture = fixture.slice(i); 9 | if (!/\/(index\.html)?$/.test(fixture)) { 10 | fixture += '/'; 11 | } 12 | 13 | if (process.env.USE_JQUERY) { 14 | fixture += '?jquery'; 15 | } 16 | 17 | browser.get('/e2e/fixtures/' + fixture); 18 | return helper; 19 | } 20 | }; 21 | 22 | global.test = helper; 23 | global.loadFixture = helper.loadFixture; 24 | -------------------------------------------------------------------------------- /src/ng/rootElement.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc service 5 | * @name $rootElement 6 | * 7 | * @description 8 | * The root element of Angular application. This is either the element where {@link 9 | * ng.directive:ngApp ngApp} was declared or the element passed into 10 | * {@link angular.bootstrap}. The element represents the root element of application. It is also the 11 | * location where the application's {@link auto.$injector $injector} service gets 12 | * published, and can be retrieved using `$rootElement.injector()`. 13 | */ 14 | 15 | 16 | // the implementation is in angular.bootstrap 17 | -------------------------------------------------------------------------------- /docs/content/error/$parse/isecff.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:isecff 3 | @fullName Referencing 'call', 'apply' and 'bind' Disallowed 4 | @description 5 | 6 | Occurs when an expression attempts to invoke Function's 'call', 'apply' or 'bind'. 7 | 8 | Angular bans the invocation of 'call', 'apply' and 'bind' from within expressions 9 | since access is a known way to modify the behaviour of existing functions. 10 | 11 | To resolve this error, avoid using these methods in expressions. 12 | 13 | Example expression that would result in this error: 14 | 15 | ``` 16 |
{{user.sendInfo.call({}, true)}}
17 | ``` 18 | -------------------------------------------------------------------------------- /src/ngScenario/angular.suffix: -------------------------------------------------------------------------------- 1 | bindJQuery(); 2 | publishExternalAPI(angular); 3 | 4 | var $runner = new angular.scenario.Runner(window), 5 | scripts = document.getElementsByTagName('script'), 6 | script = scripts[scripts.length - 1], 7 | config = {}; 8 | 9 | angular.forEach(script.attributes, function(attr) { 10 | var match = attr.name.match(/ng[:\-](.*)/); 11 | if (match) { 12 | config[match[1]] = attr.value || true; 13 | } 14 | }); 15 | 16 | if (config.autotest) { 17 | JQLite(document).ready(function() { 18 | angular.scenario.setUpAndRun(config); 19 | }); 20 | } 21 | })(window, document); 22 | 23 | -------------------------------------------------------------------------------- /docs/config/services/getVersion.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var path = require('canonical-path'); 3 | 4 | /** 5 | * dgService getVersion 6 | * @description 7 | * Find the current version of the bower component (or npm module) 8 | */ 9 | module.exports = function getVersion(readFilesProcessor) { 10 | var basePath = readFilesProcessor.basePath; 11 | 12 | return function(component, sourceFolder, packageFile) { 13 | sourceFolder = path.resolve(basePath, sourceFolder || 'docs/bower_components'); 14 | packageFile = packageFile || 'bower.json'; 15 | return require(path.join(sourceFolder,component,packageFile)).version; 16 | }; 17 | }; -------------------------------------------------------------------------------- /docs/content/error/$interpolate/logicbug.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:logicbug 3 | @fullName Bug in ngMessageFormat module 4 | @description 5 | 6 | You've just hit a bug in the ngMessageFormat module provided by angular-message-format.min.js. 7 | Please file a github issue for this and provide the interpolation text that caused you to hit this 8 | bug mentioning the exact version of AngularJS used and we will fix it! 9 | 10 | For more information about the MessageFormat syntax in interpolation 11 | expressions, please refer to MessageFormat extensions section at 12 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 13 | -------------------------------------------------------------------------------- /docs/content/error/ngTransclude/orphan.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngTransclude:orphan 3 | @fullName Orphan ngTransclude Directive 4 | @description 5 | 6 | Occurs when an `ngTransclude` occurs without a transcluded ancestor element. 7 | 8 | This error often occurs when you have forgotten to set `transclude: true` in some directive definition, and then used `ngTransclude` in the directive's template. 9 | 10 | To resolve, either remove the offending `ngTransclude` or check that `transclude: true` is included in the intended directive definition. 11 | 12 | Consult the API documentation for {@link guide/directive writing directives} to learn more. 13 | -------------------------------------------------------------------------------- /scripts/travis/wait_for_browser_provider.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Wait for Connect to be ready before exiting 5 | # Time out if we wait for more than 2 minutes, so that we can print logs. 6 | let "counter=0" 7 | 8 | while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do 9 | let "counter++" 10 | if [ $counter -gt 240 ]; then 11 | echo "Timed out after 2 minutes waiting for browser provider ready file" 12 | # We must manually print logs here because travis will not run 13 | # after_script commands if the failure occurs before the script 14 | # phase. 15 | ./scripts/travis/print_logs.sh 16 | exit 5 17 | fi 18 | sleep .5 19 | done 20 | -------------------------------------------------------------------------------- /docs/content/error/$animate/nocb.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $animate:nocb 3 | @fullName Do not pass a callback to animate methods 4 | @description 5 | 6 | Since Angular 1.3, the methods of {@link ng.$animate} do not accept a callback as the last parameter. 7 | Instead, they return a promise to which you can attach `then` handlers to be run when the animation completes. 8 | 9 | If you are getting this error then you need to update your code to use the promise-based API. 10 | 11 | See https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9 for information about 12 | the change to the animation API and the changes you need to make. 13 | -------------------------------------------------------------------------------- /docs/content/error/$resource/badcfg.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $resource:badcfg 3 | @fullName Response does not match configured parameter 4 | @description 5 | 6 | This error occurs when the {@link ngResource.$resource `$resource`} service expects a response that can be deserialized as an array but receives an object, or vice versa. 7 | By default, all resource actions expect objects, except `query` which expects arrays. 8 | 9 | To resolve this error, make sure your `$resource` configuration matches the actual format of the data returned from the server. 10 | 11 | For more information, see the {@link ngResource.$resource `$resource`} API reference documentation. 12 | -------------------------------------------------------------------------------- /docs/content/error/jqLite/nosel.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name jqLite:nosel 3 | @fullName Unsupported Selector Lookup 4 | @description 5 | 6 | In order to keep Angular small, Angular implements only a subset of the selectors in {@link angular.element#angular-s-jqlite jqLite}. 7 | This error occurs when a jqLite instance is invoked with a selector other than this subset. 8 | 9 | In order to resolve this error, rewrite your code to only use tag name selectors and manually traverse the DOM using the APIs provided by jqLite. 10 | 11 | Alternatively, you can include a full version of jQuery, which Angular will automatically use and that will make all selectors available. 12 | -------------------------------------------------------------------------------- /docs/content/error/$q/qcycle.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $q:qcycle 3 | @fullName Cannot resolve a promise with itself 4 | @description 5 | 6 | Occurs when resolving a promise with itself as the value, including returning the promise in a 7 | function passed to `then`. The A+ 1.1 spec mandates that this behavior throw a TypeError. 8 | https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure 9 | 10 | ``` 11 | var promise = $q.defer().promise; 12 | 13 | //bad 14 | promise.then(function (val) { 15 | //Cannot return self 16 | return promise; 17 | }); 18 | 19 | //good 20 | promise.then(function (val) { 21 | return 'some other value'; 22 | }); 23 | ``` 24 | -------------------------------------------------------------------------------- /i18n/e2e/localeTest_cs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | locale test 6 | 7 | 8 | 13 | 14 | 15 |
16 | date: {{input | date:"medium"}}
17 | date: {{input | date:"longDate"}}
18 | number: {{input | number}}
19 | currency: {{input | currency }} 20 | 21 | 22 | -------------------------------------------------------------------------------- /i18n/e2e/localeTest_de.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | locale test 6 | 7 | 8 | 13 | 14 | 15 |
16 | date: {{input | date:"medium"}}
17 | date: {{input | date:"longDate"}}
18 | number: {{input | number}}
19 | currency: {{input | currency }} 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/stringifySpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('toDebugString', function() { 4 | it('should convert its argument to a string', function() { 5 | expect(toDebugString('string')).toEqual('string'); 6 | expect(toDebugString(123)).toEqual('123'); 7 | expect(toDebugString({a:{b:'c'}})).toEqual('{"a":{"b":"c"}}'); 8 | expect(toDebugString(function fn() { var a = 10; })).toEqual('function fn()'); 9 | expect(toDebugString()).toEqual('undefined'); 10 | var a = { }; 11 | a.a = a; 12 | expect(toDebugString(a)).toEqual('{"a":"<>"}'); 13 | expect(toDebugString([a,a])).toEqual('[{"a":"<>"},"<>"]'); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /docs/content/error/$compile/tpload.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:tpload 3 | @fullName Error Loading Template 4 | @description 5 | 6 | This error occurs when {@link ng.$compile `$compile`} attempts to fetch a template from some URL, and the request fails. 7 | 8 | To resolve this error, ensure that the URL of the template is spelled correctly and resolves to correct absolute URL. 9 | The [Chrome Developer Tools](https://developers.google.com/chrome-developer-tools/docs/network#network_panel_overview) might also be helpful in determining why the request failed. 10 | 11 | If you are using {@link ng.$templateCache} to pre-load templates, ensure that the cache was populated with the template. 12 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/reqother.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:reqother 3 | @fullName Required choice "other" for select/plural in MessageFormat 4 | @description 5 | 6 | Your interpolation expression with a MessageFormat extension for either 7 | "plural" or "select" (typically used for gender selection) does not contain a 8 | message for the choice "other". Using either select or plural MessageFormat 9 | extensions require that you provide a message for the selection "other". 10 | 11 | For more information about the MessageFormat syntax in interpolation 12 | expressions, please refer to MessageFormat extensions section at 13 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 14 | -------------------------------------------------------------------------------- /i18n/e2e/localeTest_es.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | locale test 6 | 7 | 8 | 13 | 14 | 15 |
16 | date: {{input | date:"medium"}}
17 | date: {{input | date:"longDate"}}
18 | number: {{input | number}}
19 | currency: {{input | currency }} 20 | 21 | 22 | -------------------------------------------------------------------------------- /i18n/spec/utilSpec.js: -------------------------------------------------------------------------------- 1 | var util = require('../src/util.js'); 2 | 3 | describe('findLocaleId', function() { 4 | it('should find localeId', function() { 5 | expect(util.findLocaleId('', 'num')).toBeUndefined(); 6 | expect(util.findLocaleId('aa', 'datetime')).toBeUndefined(); 7 | expect(util.findLocaleId('aa', 'randomType')).toBeUndefined(); 8 | expect(util.findLocaleId('NumberFormatSymbols_en', 'datetime')).toBeUndefined(); 9 | expect(util.findLocaleId('DateTimeSymbols_en', 'num')).toBeUndefined(); 10 | 11 | expect(util.findLocaleId('DateTimeSymbols_en', 'datetime')).toBe('en'); 12 | expect(util.findLocaleId('NumberFormatSymbols_en_US', 'num')).toBe('en_US'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /docs/content/error/ngModel/constexpr.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngModel:constexpr 3 | @fullName Non-Constant Expression 4 | @description 5 | 6 | Some attributes used in conjunction with ngModel (such as ngTrueValue or ngFalseValue) will only 7 | accept constant expressions. 8 | 9 | Examples using constant expressions include: 10 | 11 | ``` 12 | 13 | 14 | ``` 15 | 16 | Examples of non-constant expressions include: 17 | 18 | ``` 19 | 20 | 21 | ``` 22 | -------------------------------------------------------------------------------- /init-repo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Script to initialize angular repo 4 | # - install required node packages 5 | # - install Karma 6 | # - install git hooks 7 | 8 | 9 | node=`which node 2>&1` 10 | if [ $? -ne 0 ]; then 11 | echo "Please install NodeJS." 12 | echo "http://nodejs.org/" 13 | exit 1 14 | fi 15 | 16 | npm=`which npm 2>&1` 17 | if [ $? -ne 0 ]; then 18 | echo "Please install NPM." 19 | fi 20 | 21 | 22 | echo "Installing required npm packages..." 23 | npm install 24 | 25 | karma=`which karma 2>&1` 26 | if [ $? -ne 0 ]; then 27 | echo "Installing Karma..." 28 | npm install -g karma 29 | fi 30 | 31 | echo "Installing git hooks..." 32 | ln -sf ../../validate-commit-msg.js .git/hooks/commit-msg 33 | -------------------------------------------------------------------------------- /docs/config/templates/errorNamespace.template.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.template.html' %} 2 | 3 | {% block content %} 4 |

{$ doc.name $}

5 | 6 |
7 | Here are the list of errors in the {$ doc.name $} namespace. 8 | 9 |
10 | 11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | {% for errorDoc in doc.errors -%} 19 | 20 | 21 | 22 | 23 | {% endfor %} 24 |
NameDescription
{$ errorDoc.name $}{$ errorDoc.fullName $}
25 |
26 |
27 | 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /src/stringify.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global: toDebugString: true */ 4 | 5 | function serializeObject(obj) { 6 | var seen = []; 7 | 8 | return JSON.stringify(obj, function(key, val) { 9 | val = toJsonReplacer(key, val); 10 | if (isObject(val)) { 11 | 12 | if (seen.indexOf(val) >= 0) return '<>'; 13 | 14 | seen.push(val); 15 | } 16 | return val; 17 | }); 18 | } 19 | 20 | function toDebugString(obj) { 21 | if (typeof obj === 'function') { 22 | return obj.toString().replace(/ \{[\s\S]*$/, ''); 23 | } else if (typeof obj === 'undefined') { 24 | return 'undefined'; 25 | } else if (typeof obj !== 'string') { 26 | return serializeObject(obj); 27 | } 28 | return obj; 29 | } 30 | -------------------------------------------------------------------------------- /docs/content/error/$sce/iequirks.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $sce:iequirks 3 | @fullName IE<11 in quirks mode is unsupported 4 | @description 5 | 6 | This error occurs when you are using AngularJS with {@link ng.$sce Strict Contextual Escaping (SCE)} mode enabled (the default) on IE10 or lower in quirks mode. 7 | 8 | In this mode, IE<11 allow one to execute arbitrary javascript by the use of the `expression()` syntax and is not supported. 9 | Refer 10 | [CSS expressions no longer supported for the Internet zone](http://msdn.microsoft.com/en-us/library/ie/dn384050(v=vs.85).aspx) 11 | to learn more about them. 12 | 13 | To resolve this error please specify the proper doctype at the top of your main html document: 14 | 15 | ``` 16 | 17 | ``` 18 | -------------------------------------------------------------------------------- /src/ngTouch/touch.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc module 5 | * @name ngTouch 6 | * @description 7 | * 8 | * # ngTouch 9 | * 10 | * The `ngTouch` module provides touch events and other helpers for touch-enabled devices. 11 | * The implementation is based on jQuery Mobile touch event handling 12 | * ([jquerymobile.com](http://jquerymobile.com/)). 13 | * 14 | * 15 | * See {@link ngTouch.$swipe `$swipe`} for usage. 16 | * 17 | *
18 | * 19 | */ 20 | 21 | // define ngTouch module 22 | /* global -ngTouch */ 23 | var ngTouch = angular.module('ngTouch', []); 24 | 25 | function nodeName_(element) { 26 | return angular.lowercase(element.nodeName || (element[0] && element[0].nodeName)); 27 | } 28 | -------------------------------------------------------------------------------- /docs/content/error/$parse/isecwindow.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:isecwindow 3 | @fullName Referencing Window object in Expression 4 | @description 5 | 6 | Occurs when an expression attempts to access a Window object. 7 | 8 | AngularJS restricts access to the Window object from within expressions since it's a known way to 9 | execute arbitrary Javascript code. 10 | 11 | This check is only performed on object index and function calls in Angular expressions. These are 12 | places that are harder for the developer to guard. Dotted member access (such as a.b.c) does not 13 | perform this check - it's up to the developer to not expose such sensitive and powerful objects 14 | directly on the scope chain. 15 | 16 | To resolve this error, avoid Window access. 17 | -------------------------------------------------------------------------------- /docs/content/error/ngRepeat/iexp.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngRepeat:iexp 3 | @fullName Invalid Expression 4 | @description 5 | 6 | Occurs when there is a syntax error in an {@link ng.directive:ngRepeat ngRepeat}'s expression. The expression should be in the form '_item_ in _collection_[ track by _id_]'. 7 | 8 | Be aware, the ngRepeat directive parses the expression using a regex before sending _collection_ and optionally _id_ to the AngularJS parser. This error comes from the regex parsing. 9 | 10 | To resolve, identify and fix errors in the expression, paying special attention to the 'in' and 'track by' keywords in the expression. 11 | 12 | Please consult the api documentation of {@link ng.directive:ngRepeat ngRepeat} to learn more about valid syntax. 13 | -------------------------------------------------------------------------------- /docs/content/error/$injector/pget.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $injector:pget 3 | @fullName Provider Missing $get 4 | @description 5 | 6 | This error occurs when attempting to register a provider that does not have a 7 | `$get` method. For example: 8 | 9 | ``` 10 | function BadProvider() {} // No $get method! 11 | angular.module("myApp", []) 12 | .provider('bad', BadProvider); // this throws the error 13 | ``` 14 | 15 | To fix the error, fill in the `$get` method on the provider like so: 16 | 17 | ``` 18 | function GoodProvider() { 19 | this.$get = angular.noop; 20 | } 21 | angular.module("myApp", []) 22 | .provider('good', GoodProvider); 23 | ``` 24 | 25 | For more information, refer to the {@link auto.$provide#provider 26 | $provide.provider} api doc. 27 | -------------------------------------------------------------------------------- /i18n/update-closure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e # Exit on error. 4 | 5 | BASE_DIR=`dirname $0` 6 | cd $BASE_DIR 7 | 8 | set -x # Trace commands as they're executed. 9 | 10 | I18N_BASE="https://raw.githubusercontent.com/google/closure-library/master/closure/goog/i18n" 11 | 12 | # use the github repo as it is more up to date than the svn repo 13 | curl "$I18N_BASE/currency.js" > closure/currencySymbols.js 14 | curl "$I18N_BASE/datetimesymbols.js" > closure/datetimeSymbols.js 15 | curl "$I18N_BASE/datetimesymbolsext.js" > closure/datetimeSymbolsExt.js 16 | curl "$I18N_BASE/numberformatsymbols.js" > closure/numberSymbols.js 17 | curl "$I18N_BASE/numberformatsymbolsext.js" > closure/numberSymbolsExt.js 18 | curl "$I18N_BASE/pluralrules.js" > closure/pluralRules.js 19 | -------------------------------------------------------------------------------- /docs/content/error/$sce/unsafe.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $sce:unsafe 3 | @fullName Require a safe/trusted value 4 | @description 5 | 6 | The value provided for use in a specific context was not found to be safe/trusted for use. 7 | 8 | Angular's {@link ng.$sce Strict Contextual Escaping (SCE)} mode 9 | (enabled by default), requires bindings in certain 10 | contexts to result in a value that is trusted as safe for use in such a context. (e.g. loading an 11 | Angular template from a URL requires that the URL is one considered safe for loading resources.) 12 | 13 | This helps prevent XSS and other security issues. Read more at 14 | {@link ng.$sce Strict Contextual Escaping (SCE)} 15 | 16 | You may want to include the ngSanitize module to use the automatic sanitizing. 17 | -------------------------------------------------------------------------------- /docs/content/error/$compile/multidir.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:multidir 3 | @fullName Multiple Directive Resource Contention 4 | @description 5 | 6 | This error occurs when multiple directives are applied to the same DOM element, and 7 | processing them would result in a collision or an unsupported configuration. 8 | 9 | 10 | To resolve this issue remove one of the directives which is causing the collision. 11 | 12 | Example scenarios of multiple incompatible directives applied to the same element include: 13 | 14 | * Multiple directives requesting `isolated scope`. 15 | * Multiple directives publishing a controller under the same name. 16 | * Multiple directives declared with the `transclusion` option. 17 | * Multiple directives attempting to define a `template` or `templateURL`. 18 | -------------------------------------------------------------------------------- /docs/content/error/$controller/noscp.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $controller:noscp 3 | @fullName Missing $scope object 4 | @description 5 | 6 | This error occurs when {@link ng.$controller $controller} service is called in order to instantiate a new controller but no scope is provided via `$scope` property of the locals map. 7 | 8 | Example of incorrect usage that leads to this error: 9 | ``` 10 | $controller(MyController); 11 | //or 12 | $controller(MyController, {scope: newScope}); 13 | ``` 14 | 15 | To fix the example above please provide a scope (using the `$scope` property in the locals object) to the $controller call: 16 | 17 | ``` 18 | $controller(MyController, {$scope: newScope}); 19 | ``` 20 | 21 | Please consult the {@link ng.$controller $controller} service api docs to learn more. 22 | -------------------------------------------------------------------------------- /docs/content/error/$http/badreq.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $http:badreq 3 | @fullName Bad Request Configuration 4 | @description 5 | 6 | This error occurs when the request configuration parameter passed to the {@link ng.$http `$http`} service is not an object.  `$http` expects a single parameter, the request configuration object, but received a parameter that was not an object.  The error message should provide additional context such as the actual value of the parameter that was received.  If you passed a string parameter, perhaps you meant to call one of the shorthand methods on `$http` such as `$http.get(…)`, etc. 7 | 8 | To resolve this error, make sure you pass a valid request configuration object to `$http`. 9 | 10 | For more information, see the {@link ng.$http `$http`} service API documentation. 11 | -------------------------------------------------------------------------------- /test/ng/directive/ngClickSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngClick', function() { 4 | var element; 5 | 6 | afterEach(function() { 7 | dealoc(element); 8 | }); 9 | 10 | it('should get called on a click', inject(function($rootScope, $compile) { 11 | element = $compile('
')($rootScope); 12 | $rootScope.$digest(); 13 | expect($rootScope.clicked).toBeFalsy(); 14 | 15 | browserTrigger(element, 'click'); 16 | expect($rootScope.clicked).toEqual(true); 17 | })); 18 | 19 | it('should pass event object', inject(function($rootScope, $compile) { 20 | element = $compile('
')($rootScope); 21 | $rootScope.$digest(); 22 | 23 | browserTrigger(element, 'click'); 24 | expect($rootScope.event).toBeDefined(); 25 | })); 26 | }); 27 | -------------------------------------------------------------------------------- /test/ng/documentSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$document', function() { 4 | 5 | 6 | it("should inject $document", inject(function($document) { 7 | expect($document).toEqual(jqLite(document)); 8 | })); 9 | 10 | 11 | it('should be able to mock $document object', function() { 12 | module({$document: {}}); 13 | inject(function($httpBackend, $http) { 14 | $httpBackend.expectGET('/dummy').respond('dummy'); 15 | $http.get('/dummy'); 16 | $httpBackend.flush(); 17 | }); 18 | }); 19 | 20 | 21 | it('should be able to mock $document array', function() { 22 | module({$document: [{}]}); 23 | inject(function($httpBackend, $http) { 24 | $httpBackend.expectGET('/dummy').respond('dummy'); 25 | $http.get('/dummy'); 26 | $httpBackend.flush(); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /docs/content/error/ngRepeat/iidexp.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngRepeat:iidexp 3 | @fullName Invalid Identifier 4 | @description 5 | 6 | Occurs when there is an error in the identifier part of {@link ng.directive:ngRepeat ngRepeat}'s expression. 7 | 8 | To resolve, use either a valid identifier or a tuple (_key_, _value_) where both _key_ and _value_ are valid identifiers. 9 | 10 | Examples of *invalid* syntax: 11 | 12 | ``` 13 |
14 |
15 |
16 | ``` 17 | 18 | Examples of *valid* syntax: 19 | 20 | ``` 21 |
22 |
23 | ``` 24 | 25 | Please consult the api documentation of {@link ng.directive:ngRepeat ngRepeat} to learn more about valid syntax. 26 | -------------------------------------------------------------------------------- /docs/content/error/ngModel/nonassign.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngModel:nonassign 3 | @fullName Non-Assignable Expression 4 | @description 5 | 6 | This error occurs when expression the {@link ng.directive:ngModel ngModel} directive is bound to is a non-assignable expression. 7 | 8 | Examples using assignable expressions include: 9 | 10 | ``` 11 | 12 | 13 | 14 | ``` 15 | 16 | Examples of non-assignable expressions include: 17 | 18 | ``` 19 | 20 | 21 | 22 | 23 | ``` 24 | 25 | Always make sure that the expression bound via `ngModel` directive can be assigned to. 26 | 27 | For more information, see the {@link ng.directive:ngModel ngModel API doc}. 28 | -------------------------------------------------------------------------------- /docs/content/error/$parse/isecfld.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $parse:isecfld 3 | @fullName Referencing Disallowed Field in Expression 4 | @description 5 | 6 | Occurs when an expression attempts to access one of the following fields: 7 | 8 | * __proto__ 9 | * __defineGetter__ 10 | * __defineSetter__ 11 | * __lookupGetter__ 12 | * __lookupSetter__ 13 | 14 | AngularJS bans access to these fields from within expressions since 15 | access is a known way to mess with native objects or 16 | to execute arbitrary Javascript code. 17 | 18 | To resolve this error, avoid using these fields in expressions. As a last resort, 19 | alias their value and access them through the alias instead. 20 | 21 | Example expressions that would result in this error: 22 | 23 | ``` 24 |
{{user.__proto__.hasOwnProperty = $emit}}
25 | 26 |
{{user.__defineGetter__('name', noop)}}
27 | ``` 28 | -------------------------------------------------------------------------------- /docs/content/error/$compile/iscp.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:iscp 3 | @fullName Invalid Isolate Scope Definition 4 | @description 5 | 6 | When declaring isolate scope the scope definition object must be in specific format which starts with mode character (`@&=`) with an optional local name. 7 | 8 | ``` 9 | myModule.directive('directiveName', function factory() { 10 | return { 11 | ... 12 | scope: { 13 | 'attrName': '@', // OK 14 | 'attrName2': '=localName', // OK 15 | 'attrName3': 'name', // ERROR: missing mode @&= 16 | 'attrName4': ' = name', // ERROR: extra spaces 17 | 'attrName5': 'name=', // ERROR: must be prefixed with @&= 18 | } 19 | ... 20 | } 21 | }); 22 | ``` 23 | 24 | Please refer to the {@link ng.$compile#directive-definition-object 25 | `scope` option} of the directive definition documentation to learn more about the API. 26 | -------------------------------------------------------------------------------- /test/ngCookies/cookieStoreSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$cookieStore', function() { 4 | 5 | beforeEach(module('ngCookies', { 6 | $cookies: jasmine.createSpyObj('$cookies', ['getObject', 'putObject', 'remove']) 7 | })); 8 | 9 | 10 | it('should get cookie', inject(function($cookieStore, $cookies) { 11 | $cookies.getObject.andReturn('value'); 12 | expect($cookieStore.get('name')).toBe('value'); 13 | expect($cookies.getObject).toHaveBeenCalledWith('name'); 14 | })); 15 | 16 | 17 | it('should put cookie', inject(function($cookieStore, $cookies) { 18 | $cookieStore.put('name', 'value'); 19 | expect($cookies.putObject).toHaveBeenCalledWith('name', 'value'); 20 | })); 21 | 22 | 23 | it('should remove cookie', inject(function($cookieStore, $cookies) { 24 | $cookieStore.remove('name'); 25 | expect($cookies.remove).toHaveBeenCalledWith('name'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /docs/content/error/$interpolate/nochgmustache.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $interpolate:nochgmustache 3 | @fullName Redefinition of start/endSymbol incompatible with MessageFormat extensions 4 | @description 5 | 6 | You have redefined `$interpolate.startSymbol`/`$interpolate.endSymbol` and also 7 | loaded the `ngMessageFormat` module (provided by angular-message-format.min.js) 8 | while creating your injector. 9 | 10 | `ngMessageFormat` currently does not support redefinition of the 11 | startSymbol/endSymbol used by `$interpolate`. If this is affecting you, please 12 | file an issue and mention @chirayuk on it. This is intended to be fixed in a 13 | future commit and the github issue will help gauge urgency. 14 | 15 | For more information about the MessageFormat syntax in interpolation 16 | expressions, please refer to MessageFormat extensions section at 17 | {@link guide/i18n#MessageFormat Angular i18n MessageFormat} 18 | -------------------------------------------------------------------------------- /test/ng/exceptionHandlerSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$exceptionHandler', function() { 4 | /* global $ExceptionHandlerProvider:false */ 5 | it('should log errors with single argument', function() { 6 | module(function($provide) { 7 | $provide.provider('$exceptionHandler', $ExceptionHandlerProvider); 8 | }); 9 | inject(function($log, $exceptionHandler) { 10 | $exceptionHandler('myError'); 11 | expect($log.error.logs.shift()).toEqual(['myError']); 12 | }); 13 | }); 14 | 15 | 16 | it('should log errors with multiple arguments', function() { 17 | module(function($provide) { 18 | $provide.provider('$exceptionHandler', $ExceptionHandlerProvider); 19 | }); 20 | inject(function($log, $exceptionHandler) { 21 | $exceptionHandler('myError', 'comment'); 22 | expect($log.error.logs.shift()).toEqual(['myError', 'comment']); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /docs/content/error/$injector/cdep.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $injector:cdep 3 | @fullName Circular Dependency 4 | @description 5 | 6 | This error occurs when the {@link angular.injector $injector} tries to get 7 | a service that depends on itself, either directly or indirectly. To fix this, 8 | construct your dependency chain such that there are no circular dependencies. 9 | 10 | For example: 11 | 12 | ``` 13 | angular.module('myApp', []) 14 | .factory('myService', function (myService) { 15 | // ... 16 | }) 17 | .controller('MyCtrl', function ($scope, myService) { 18 | // ... 19 | }); 20 | ``` 21 | 22 | When an instance of `MyCtrl` is created, the service `myService` will be created 23 | by the `$injector`. `myService` depends on itself, which causes the `$injector` 24 | to detect a circular dependency and throw the error. 25 | 26 | For more information, see the {@link guide/di Dependency Injection Guide}. 27 | -------------------------------------------------------------------------------- /protractor-shared-conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.config = { 4 | allScriptsTimeout: 11000, 5 | 6 | baseUrl: 'http://localhost:8000/', 7 | 8 | framework: 'jasmine', 9 | 10 | onPrepare: function() { 11 | /* global angular: false, browser: false, jasmine: false */ 12 | 13 | // Disable animations so e2e tests run more quickly 14 | var disableNgAnimate = function() { 15 | angular.module('disableNgAnimate', []).run(['$animate', function($animate) { 16 | $animate.enabled(false); 17 | }]); 18 | }; 19 | 20 | browser.addMockModule('disableNgAnimate', disableNgAnimate); 21 | 22 | // Store the name of the browser that's currently being used. 23 | browser.getCapabilities().then(function(caps) { 24 | browser.params.browser = caps.get('browserName'); 25 | }); 26 | }, 27 | 28 | jasmineNodeOpts: { 29 | defaultTimeoutInterval: 60000, 30 | showTiming: true 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /docs/content/error/$injector/undef.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $injector:undef 3 | @fullName Undefined Value 4 | @description 5 | 6 | This error results from registering a factory which does not return a value (or whose return value is undefined). 7 | 8 | The following is an example of a factory which will throw this error upon injection: 9 | 10 | ```js 11 | angular.module("badModule", []). 12 | factory("badFactory", function() { 13 | doLotsOfThings(); 14 | butDontReturnAValue(); 15 | }); 16 | ``` 17 | 18 | In order to prevent the error, return a value of some sort, such as an object which exposes an API for working 19 | with the injected object. 20 | 21 | ```js 22 | angular.module("goodModule", []). 23 | factory("goodFactory", function() { 24 | doLotsOfThings(); 25 | butDontReturnAValue(); 26 | 27 | return { 28 | doTheThing: function methodThatDoesAThing() { 29 | } 30 | }; 31 | }); 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /docs/content/error/$injector/itkn.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $injector:itkn 3 | @fullName Bad Injection Token 4 | @description 5 | 6 | This error occurs when using a bad token as a dependency injection annotation. 7 | Dependency injection annotation tokens should always be strings. Using any other 8 | type will cause this error to be thrown. 9 | 10 | Examples of code with bad injection tokens include: 11 | 12 | ``` 13 | var myCtrl = function ($scope, $http) { /* ... */ }; 14 | myCtrl.$inject = ['$scope', 42]; 15 | 16 | myAppModule.controller('MyCtrl', ['$scope', {}, function ($scope, $timeout) { 17 | // ... 18 | }]); 19 | ``` 20 | 21 | The bad injection tokens are `42` in the first example and `{}` in the second. 22 | To avoid the error, always use string literals for dependency injection annotation 23 | tokens. 24 | 25 | For an explanation of what injection annotations are and how to use them, refer 26 | to the {@link guide/di Dependency Injection Guide}. 27 | -------------------------------------------------------------------------------- /docs/content/error/$resource/badmember.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $resource:badmember 3 | @fullName Syntax error in param value using @member lookup 4 | @description 5 | 6 | Occurs when there is a syntax error when attempting to extract a param 7 | value from the data object. 8 | 9 | Here's an example of valid syntax for `params` or `paramsDefault`: 10 | 11 | ````javascript 12 | { 13 | bar: '@foo.bar' 14 | } 15 | ```` 16 | 17 | The part following the `@`, `foo.bar` in this case, should be a simple 18 | dotted member lookup using only ASCII identifiers. This error occurs 19 | when there is an error in that expression. The following are all syntax 20 | errors 21 | 22 | | Value | Error | 23 | |---------|----------------| 24 | | `@` | Empty expression following `@`. | 25 | | `@1.a` | `1` is an invalid javascript identifier. | 26 | | `@.a` | Leading `.` is invalid. | 27 | | `@a[1]` | Only dotted lookups are supported (no index operator) | 28 | -------------------------------------------------------------------------------- /README.closure.md: -------------------------------------------------------------------------------- 1 | Using AngularJS with the Closure Compiler 2 | ========================================= 3 | 4 | The Closure Compiler project contains definitions for the AngularJS JavaScript 5 | in its `contrib/externs` directory. 6 | 7 | The definitions contain externs for use with the Closure compiler (aka 8 | JSCompiler). Passing these files to the --externs parameter of a compiler 9 | pass allows using type annotations for AngularJS objects. For example, 10 | Angular's $scope objects can be annotated as: 11 | ```js 12 | /** @type {angular.Scope} */ 13 | var scope = $scope; 14 | ``` 15 | 16 | This allows JSCompiler to type check accesses to scope, give warnings about 17 | missing methods or incorrect arguments, and also prevents renaming of property 18 | accesses with advanced compilation. 19 | 20 | The externs are incomplete and maintained on an as-needed basis, but strive to 21 | be correct. Externs for individual modules should be added in separate files. 22 | 23 | See https://developers.google.com/closure/compiler/ 24 | -------------------------------------------------------------------------------- /docs/content/error/$compile/selmulti.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:selmulti 3 | @fullName Binding to Multiple Attribute 4 | @description 5 | 6 | Binding to the `multiple` attribute of `select` element is not supported since switching between multiple and single mode changes the {@link ng.directive:ngModel `ngModel`} object type from instance to array of instances which breaks the model semantics. 7 | 8 | If you need to use different types of `select` elements in your template based on some variable, please use {@link ng.directive:ngIf ngIf} or {@link ng.directive:ngSwitch ngSwitch} directives to select one of them to be used at runtime. 9 | 10 | 11 | Example with invalid usage: 12 | ``` 13 | 14 | ``` 15 | 16 | Example that uses ngIf to pick one of the `select` elements based on a variable: 17 | ``` 18 | 19 | 20 | ``` 21 | -------------------------------------------------------------------------------- /docs/content/error/$compile/nodomevents.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:nodomevents 3 | @fullName Interpolated Event Attributes 4 | @description 5 | 6 | This error occurs when one tries to create a binding for event handler attributes like `onclick`, `onload`, `onsubmit`, etc. 7 | 8 | There is no practical value in binding to these attributes and doing so only exposes your application to security vulnerabilities like XSS. 9 | For these reasons binding to event handler attributes (all attributes that start with `on` and `formaction` attribute) is not supported. 10 | 11 | 12 | An example code that would allow XSS vulnerability by evaluating user input in the window context could look like this: 13 | ``` 14 | 15 |
click me
16 | ``` 17 | 18 | Since the `onclick` evaluates the value as JavaScript code in the window context, setting the `username` model to a value like `javascript:alert('PWND')` would result in script injection when the `div` is clicked. 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/ngScenario/mocks.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | angular.scenario.testing = angular.scenario.testing || {}; 4 | 5 | angular.scenario.testing.MockAngular = function() { 6 | this.reset(); 7 | this.element = jqLite; 8 | }; 9 | 10 | angular.scenario.testing.MockAngular.prototype.reset = function() { 11 | this.log = []; 12 | }; 13 | 14 | angular.scenario.testing.MockAngular.prototype.poll = function() { 15 | this.log.push('$brower.poll()'); 16 | return this; 17 | }; 18 | 19 | angular.scenario.testing.MockRunner = function() { 20 | this.listeners = []; 21 | }; 22 | 23 | angular.scenario.testing.MockRunner.prototype.on = function(eventName, fn) { 24 | this.listeners[eventName] = this.listeners[eventName] || []; 25 | this.listeners[eventName].push(fn); 26 | }; 27 | 28 | angular.scenario.testing.MockRunner.prototype.emit = function(eventName) { 29 | var args = Array.prototype.slice.call(arguments, 1); 30 | angular.forEach(this.listeners[eventName] || [], function(fn) { 31 | fn.apply(this, args); 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /docs/content/tutorial/the_end.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc tutorial 2 | @name The End 3 | @step 99 4 | @description 5 | 6 | Our application is now complete. Feel free to experiment with the code further, and jump back to 7 | previous steps using the `git checkout` command. 8 | 9 | For more details and examples of the Angular concepts we touched on in this tutorial, see the 10 | {@link guide/ Developer Guide}. 11 | 12 | When you are ready to start developing a project using Angular, we recommend that you bootstrap 13 | your development with the [angular-seed](https://github.com/angular/angular-seed) project. 14 | 15 | We hope this tutorial was useful to you and that you learned enough about Angular to make you want 16 | to learn more. We especially hope you are inspired to go out and develop Angular web apps of your 17 | own, and that you might be interested in {@link misc/contribute contributing} to Angular. 18 | 19 | If you have questions or feedback or just want to say "hi", please post a message at (https://groups.google.com/forum/#!forum/angular). 20 | -------------------------------------------------------------------------------- /i18n/e2e/localeTest_sk.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | locale test 6 | 7 | 8 | 14 | 15 | 16 |
17 | date: {{input | date:"medium"}}
18 | date: {{input | date:"longDate"}}
19 | number: {{input | number}}
20 | currency: {{input | currency }} 21 |
22 |
23 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/ng/forceReflow.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var $$ForceReflowProvider = function() { 4 | this.$get = ['$document', function($document) { 5 | return function(domNode) { 6 | //the line below will force the browser to perform a repaint so 7 | //that all the animated elements within the animation frame will 8 | //be properly updated and drawn on screen. This is required to 9 | //ensure that the preparation animation is properly flushed so that 10 | //the active state picks up from there. DO NOT REMOVE THIS LINE. 11 | //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH 12 | //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND 13 | //WILL TAKE YEARS AWAY FROM YOUR LIFE. 14 | if (domNode) { 15 | if (!domNode.nodeType && domNode instanceof jqLite) { 16 | domNode = domNode[0]; 17 | } 18 | } else { 19 | domNode = $document[0].body; 20 | } 21 | return domNode.offsetWidth + 1; 22 | }; 23 | }]; 24 | }; 25 | -------------------------------------------------------------------------------- /test/ngSanitize/directive/ngBindHtmlSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | describe('ngBindHtml', function() { 5 | beforeEach(module('ngSanitize')); 6 | 7 | it('should set html', inject(function($rootScope, $compile) { 8 | var element = $compile('
')($rootScope); 9 | $rootScope.html = '
hello
'; 10 | $rootScope.$digest(); 11 | expect(angular.lowercase(element.html())).toEqual('
hello
'); 12 | })); 13 | 14 | 15 | it('should reset html when value is null or undefined', inject(function($compile, $rootScope) { 16 | var element = $compile('
')($rootScope); 17 | 18 | angular.forEach([null, undefined, ''], function(val) { 19 | $rootScope.html = 'some val'; 20 | $rootScope.$digest(); 21 | expect(angular.lowercase(element.html())).toEqual('some val'); 22 | 23 | $rootScope.html = val; 24 | $rootScope.$digest(); 25 | expect(angular.lowercase(element.html())).toEqual(''); 26 | }); 27 | })); 28 | }); 29 | -------------------------------------------------------------------------------- /docs/app/e2e/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../.jshintrc-base", 3 | 4 | "globals": { 5 | 6 | /* jasmine / karma */ 7 | "it": false, 8 | "iit": false, 9 | "describe": false, 10 | "ddescribe": false, 11 | "beforeEach": false, 12 | "afterEach": false, 13 | "expect": false, 14 | "jasmine": false, 15 | "spyOn": false, 16 | "waits": false, 17 | "waitsFor": false, 18 | "runs": false, 19 | "dump": false, 20 | 21 | /* e2e */ 22 | "browser": false, 23 | "element": false, 24 | "by": false, 25 | 26 | /* testabilityPatch / matchers */ 27 | "inject": false, 28 | "module": false, 29 | "dealoc": false, 30 | "_jQuery": false, 31 | "_jqLiteMode": false, 32 | "sortedHtml": false, 33 | "childrenTagsOf": false, 34 | "assertHidden": false, 35 | "assertVisible": false, 36 | "provideLog": false, 37 | "spyOnlyCallsWithArgs": false, 38 | "createMockStyleSheet": false, 39 | "browserTrigger": false, 40 | "jqLiteCacheSize": false 41 | } 42 | } -------------------------------------------------------------------------------- /docs/app/src/versions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | angular.module('versions', []) 4 | 5 | .controller('DocsVersionsCtrl', ['$scope', '$location', '$window', 'NG_VERSIONS', function($scope, $location, $window, NG_VERSIONS) { 6 | $scope.docs_version = NG_VERSIONS[0]; 7 | $scope.docs_versions = NG_VERSIONS; 8 | 9 | for(var i=0, minor = NaN; i < NG_VERSIONS.length; i++) { 10 | var version = NG_VERSIONS[i]; 11 | // NaN will give false here 12 | if (minor <= version.minor) { 13 | continue; 14 | } 15 | version.isLatest = true; 16 | minor = version.minor; 17 | } 18 | 19 | $scope.getGroupName = function(v) { 20 | return v.isLatest ? 'Latest' : ('v' + v.major + '.' + v.minor + '.x'); 21 | }; 22 | 23 | $scope.jumpToDocsVersion = function(version) { 24 | var currentPagePath = $location.path().replace(/\/$/, ''), 25 | url = ''; 26 | if (version.isOldDocsUrl) { 27 | url = version.docsUrl; 28 | }else{ 29 | url = version.docsUrl + currentPagePath; 30 | } 31 | $window.location = url; 32 | }; 33 | }]); 34 | -------------------------------------------------------------------------------- /docs/content/error/ngRepeat/dupes.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngRepeat:dupes 3 | @fullName Duplicate Key in Repeater 4 | @description 5 | 6 | Occurs if there are duplicate keys in an {@link ng.directive:ngRepeat ngRepeat} expression. Duplicate keys are banned because AngularJS uses keys to associate DOM nodes with items. 7 | 8 | By default, collections are keyed by reference which is desirable for most common models but can be problematic for primitive types that are interned (share references). 9 | 10 | For example the issue can be triggered by this *invalid* code: 11 | 12 | ``` 13 |
14 | ``` 15 | 16 | To resolve this error either ensure that the items in the collection have unique identity or use the `track by` syntax to specify how to track the association between models and DOM. 17 | 18 | The example above can be resolved by using `track by $index`, which will cause the items to be keyed by their position in the array instead of their value: 19 | 20 | ``` 21 |
22 | ``` 23 | -------------------------------------------------------------------------------- /src/ng/raf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function $$RAFProvider() { //rAF 4 | this.$get = ['$window', '$timeout', function($window, $timeout) { 5 | var requestAnimationFrame = $window.requestAnimationFrame || 6 | $window.webkitRequestAnimationFrame; 7 | 8 | var cancelAnimationFrame = $window.cancelAnimationFrame || 9 | $window.webkitCancelAnimationFrame || 10 | $window.webkitCancelRequestAnimationFrame; 11 | 12 | var rafSupported = !!requestAnimationFrame; 13 | var raf = rafSupported 14 | ? function(fn) { 15 | var id = requestAnimationFrame(fn); 16 | return function() { 17 | cancelAnimationFrame(id); 18 | }; 19 | } 20 | : function(fn) { 21 | var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666 22 | return function() { 23 | $timeout.cancel(timer); 24 | }; 25 | }; 26 | 27 | raf.supported = rafSupported; 28 | 29 | return raf; 30 | }]; 31 | } 32 | -------------------------------------------------------------------------------- /docs/config/processors/versions-data.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _ = require('lodash'); 4 | 5 | /** 6 | * @dgProcessor generateVersionDocProcessor 7 | * @description 8 | * This processor will create a new doc that will be rendered as a JavaScript file 9 | * containing meta information about the current versions of AngularJS 10 | */ 11 | module.exports = function generateVersionDocProcessor(gitData) { 12 | return { 13 | $runAfter: ['generatePagesDataProcessor'], 14 | $runBefore: ['rendering-docs'], 15 | $process: function(docs) { 16 | 17 | var versionDoc = { 18 | docType: 'versions-data', 19 | id: 'versions-data', 20 | template: 'versions-data.template.js', 21 | outputPath: 'js/versions-data.js', 22 | currentVersion: gitData.version 23 | }; 24 | 25 | versionDoc.versions = _(gitData.versions) 26 | .filter(function(version) { return version.major > 0; }) 27 | .push(gitData.version) 28 | .reverse() 29 | .value(); 30 | 31 | docs.push(versionDoc); 32 | } 33 | }; 34 | }; -------------------------------------------------------------------------------- /src/ng/document.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc service 5 | * @name $document 6 | * @requires $window 7 | * 8 | * @description 9 | * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object. 10 | * 11 | * @example 12 | 13 | 14 |
15 |

$document title:

16 |

window.document title:

17 |
18 |
19 | 20 | angular.module('documentExample', []) 21 | .controller('ExampleController', ['$scope', '$document', function($scope, $document) { 22 | $scope.title = $document[0].title; 23 | $scope.windowTitle = angular.element(window.document)[0].title; 24 | }]); 25 | 26 |
27 | */ 28 | function $DocumentProvider() { 29 | this.$get = ['$window', function(window) { 30 | return jqLite(window.document); 31 | }]; 32 | } 33 | -------------------------------------------------------------------------------- /scripts/jenkins/master.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "#################################" 4 | echo "#### Update master ##############" 5 | echo "#################################" 6 | 7 | ARG_DEFS=( 8 | "[--no-test=(true|false)]" 9 | ) 10 | 11 | function init { 12 | if [[ ! $VERBOSE ]]; then 13 | VERBOSE=false 14 | fi 15 | VERBOSE_ARG="--verbose=$VERBOSE" 16 | } 17 | 18 | function build { 19 | cd ../.. 20 | 21 | if [[ $NO_TEST == "true" ]]; then 22 | npm install --color false 23 | grunt ci-checks package --no-color 24 | else 25 | ./jenkins_build.sh 26 | fi 27 | 28 | cd $SCRIPT_DIR 29 | } 30 | 31 | function phase { 32 | ACTION_ARG="--action=$1" 33 | ../code.angularjs.org/publish.sh $ACTION_ARG $VERBOSE_ARG 34 | ../bower/publish.sh $ACTION_ARG $VERBOSE_ARG 35 | } 36 | 37 | function run { 38 | build 39 | 40 | # First prepare all scripts (build, test, commit, tag, ...), 41 | # so we are sure everything is all right 42 | phase prepare 43 | # only then publish to github 44 | phase publish 45 | } 46 | 47 | source $(dirname $0)/../utils.inc 48 | -------------------------------------------------------------------------------- /docs/app/e2e/api-docs/service-pages.scenario.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe("service pages", function() { 4 | 5 | it("should show the related provider if there is one", function() { 6 | browser.get('build/docs/index.html#!/api/ng/service/$compile'); 7 | var providerLink = element.all(by.css('ol.api-profile-header-structure li a')).first(); 8 | expect(providerLink.getText()).toEqual('- $compileProvider'); 9 | expect(providerLink.getAttribute('href')).toMatch(/api\/ng\/provider\/\$compileProvider/); 10 | 11 | browser.get('build/docs/index.html#!/api/ng/service/$q'); 12 | providerLink = element.all(by.css('ol.api-profile-header-structure li a')).first(); 13 | expect(providerLink.getText()).not.toEqual('- $qProvider'); 14 | expect(providerLink.getAttribute('href')).not.toMatch(/api\/ng\/provider\/\$compileProvider/); 15 | }); 16 | 17 | it("should show parameter defaults", function() { 18 | browser.get('build/docs/index.html#!/api/ng/service/$timeout'); 19 | expect(element.all(by.css('.input-arguments p em')).first().getText()).toContain('(default: 0)'); 20 | }); 21 | 22 | }); -------------------------------------------------------------------------------- /docs/content/error/$compile/uterdir.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $compile:uterdir 3 | @fullName Unterminated Directive 4 | @description 5 | 6 | This error occurs when using multi-element directives and a `directive-start` attribute fails to form a matching pair with a corresponding `directive-end` attribute. 7 | A `directive-start` should have a matching `directive-end` on a sibling node in the DOM. For instance, 8 | 9 | ``` 10 | 11 | I get repeated 12 | I also get repeated 13 |
14 | ``` 15 | 16 | is a valid example. 17 | 18 | This error can occur in several different ways. One is by leaving out the `directive-end` attribute, like so: 19 | 20 | ``` 21 |
22 | 23 |
24 | ``` 25 | 26 | Another is by nesting a `directive-end` inside of `directive-start`, or vice versa: 27 | 28 | ``` 29 |
30 | 31 |
32 | ``` 33 | 34 | To avoid this error, make sure each `directive-start` you use has a matching `directive-end` on a sibling node in the DOM. 35 | -------------------------------------------------------------------------------- /docs/content/error/$injector/modulerr.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $injector:modulerr 3 | @fullName Module Error 4 | @description 5 | 6 | This error occurs when a module fails to load due to some exception. The error 7 | message above should provide additional context. 8 | 9 | ### Using `ngRoute` 10 | 11 | In AngularJS `1.2.0` and later, `ngRoute` has been moved to its own module. 12 | If you are getting this error after upgrading to `1.2.x` or later, be sure that you've 13 | installed {@link ngRoute `ngRoute`}. 14 | 15 | ### Monkey-patching Angular's `ng` module 16 | 17 | This error can also occur if you have tried to add your own components to the `ng` module. 18 | This has never been supported and from `1.3.0` it will actually trigger this error. 19 | For instance the following code could trigger this error. 20 | 21 | ```js 22 | angular.module('ng').filter('tel', function (){}); 23 | ``` 24 | 25 | Instead create your own module and add it as a dependency to your application's top-level module. 26 | See [#9692](https://github.com/angular/angular.js/issues/9692) and 27 | [#7709](https://github.com/angular/angular.js/issues/7709) for more information -------------------------------------------------------------------------------- /test/e2e/tools/util.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var fs = require('fs'); 4 | var path = require('path'); 5 | var url = require('url'); 6 | 7 | var root = path.resolve(__dirname, '..'); 8 | var tests = path.resolve(root, 'fixtures'); 9 | 10 | function stat(path) { 11 | try { 12 | return fs.statSync(path); 13 | } catch (e) { 14 | // Ignore ENOENT. 15 | if (e.code !== 'ENOENT') { 16 | throw e; 17 | } 18 | } 19 | } 20 | 21 | function testExists(testname) { 22 | var s = stat(path.resolve(tests, testname)); 23 | return s && s.isDirectory(); 24 | } 25 | 26 | function rewriteTestFile(testname, testfile) { 27 | if (testfile.search(/^https?:\/\//) === 0) { 28 | return testfile; 29 | } 30 | 31 | var i = 0; 32 | while (testfile[i] === '/') ++i; 33 | testfile = testfile.slice(i); 34 | var s = stat(path.resolve(tests, testname, testfile)); 35 | if (s && (s.isFile() || s.isDirectory())) { 36 | return ['/test/e2e/fixtures', testname, testfile].join('/'); 37 | } 38 | return false; 39 | } 40 | 41 | module.exports = { 42 | stat: stat, 43 | testExists: testExists, 44 | rewriteTestFile: rewriteTestFile 45 | }; 46 | -------------------------------------------------------------------------------- /protractor-jenkins-conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.config = { 4 | allScriptsTimeout: 11000, 5 | 6 | specs: [ 7 | 'test/e2e/tests/**/*.js', 8 | 'build/docs/ptore2e/**/*.js', 9 | 'docs/app/e2e/*.scenario.js' 10 | ], 11 | 12 | capabilities: { 13 | 'browserName': 'chrome' 14 | }, 15 | 16 | baseUrl: 'http://localhost:8000/', 17 | 18 | framework: 'jasmine', 19 | 20 | onPrepare: function() { 21 | /* global angular: false, browser: false, jasmine: false */ 22 | 23 | // Disable animations so e2e tests run more quickly 24 | var disableNgAnimate = function() { 25 | angular.module('disableNgAnimate', []).run(['$animate', function($animate) { 26 | $animate.enabled(false); 27 | }]); 28 | }; 29 | 30 | browser.addMockModule('disableNgAnimate', disableNgAnimate); 31 | 32 | require('jasmine-reporters'); 33 | jasmine.getEnv().addReporter( 34 | new jasmine.JUnitXmlReporter('test_out/docs-e2e-' + exports.config.capabilities.browserName + '-', true, true)); 35 | }, 36 | 37 | jasmineNodeOpts: { 38 | defaultTimeoutInterval: 30000, 39 | showColors: false 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /test/ngScenario/output/jsonSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('angular.scenario.output.json', function() { 4 | var output, context; 5 | var runner, model, $window; 6 | var spec, step; 7 | 8 | beforeEach(function() { 9 | $window = {}; 10 | context = _jQuery('
'); 11 | runner = new angular.scenario.testing.MockRunner(); 12 | model = new angular.scenario.ObjectModel(runner); 13 | output = angular.scenario.output.json(context, runner, model); 14 | spec = { 15 | name: 'test spec', 16 | definition: { 17 | id: 10, 18 | name: 'describe' 19 | } 20 | }; 21 | step = { 22 | name: 'some step', 23 | line: function() { return 'unknown:-1'; } 24 | }; 25 | }); 26 | 27 | it('should put json in context on RunnerEnd', function() { 28 | runner.emit('SpecBegin', spec); 29 | runner.emit('StepBegin', spec, step); 30 | runner.emit('StepEnd', spec, step); 31 | runner.emit('SpecEnd', spec); 32 | runner.emit('RunnerEnd'); 33 | 34 | expect(angular.fromJson(context.html()).children['describe'] 35 | .specs['test spec'].status).toEqual('success'); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /docs/content/error/ng/btstrpd.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ng:btstrpd 3 | @fullName App Already Bootstrapped with this Element 4 | @description 5 | 6 | Occurs when calling {@link angular.bootstrap} on an element that has already been bootstrapped. 7 | 8 | This usually happens when you accidentally use both `ng-app` and `angular.bootstrap` to bootstrap an 9 | application. 10 | 11 | 12 | ``` 13 | 14 | ... 15 | 16 | 19 | 20 | 21 | ``` 22 | 23 | Note that for bootstrapping purposes, the `` element is the same as `document`, so the following 24 | will also throw an error. 25 | 26 | ``` 27 | 28 | ... 29 | 32 | 33 | ``` 34 | 35 | You can also get this error if you accidentally load AngularJS itself more than once. 36 | 37 | ``` 38 | 39 | 40 | 41 | 42 | ... 43 | 44 | 45 | 46 | 47 | ... 48 | 49 | 50 | 51 | 52 | ``` 53 | -------------------------------------------------------------------------------- /scripts/angular.js/tag-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Tags a release 4 | # so that travis can do the actual release. 5 | 6 | echo "#################################" 7 | echo "## Tag angular.js for a release #" 8 | echo "#################################" 9 | 10 | ARG_DEFS=( 11 | "--action=(prepare|publish)" 12 | "--commit-sha=(.*)" 13 | # the version number of the release. 14 | # e.g. 1.2.12 or 1.2.12-rc.1 15 | "--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)" 16 | "--version-name=(.+)" 17 | ) 18 | 19 | function checkVersionNumber() { 20 | BRANCH_PATTERN=$(readJsonProp "package.json" "branchPattern") 21 | if [[ $VERSION_NUMBER != $BRANCH_PATTERN ]]; then 22 | echo "version-number needs to match $BRANCH_PATTERN on this branch" 23 | usage 24 | fi 25 | } 26 | 27 | function init { 28 | cd ../.. 29 | checkVersionNumber 30 | TAG_NAME="v$VERSION_NUMBER" 31 | } 32 | 33 | function prepare() { 34 | git tag "$TAG_NAME" -m "chore(release): $TAG_NAME codename($VERSION_NAME)" "$COMMIT_SHA" 35 | } 36 | 37 | function publish() { 38 | # push the tag to github 39 | git push origin $TAG_NAME 40 | } 41 | 42 | source $(dirname $0)/../utils.inc 43 | -------------------------------------------------------------------------------- /docs/app/src/directives.js: -------------------------------------------------------------------------------- 1 | angular.module('directives', []) 2 | 3 | /** 4 | * backToTop Directive 5 | * @param {Function} $anchorScroll 6 | * 7 | * @description Ensure that the browser scrolls when the anchor is clicked 8 | */ 9 | .directive('backToTop', ['$anchorScroll', '$location', function($anchorScroll, $location) { 10 | return function link(scope, element) { 11 | element.on('click', function(event) { 12 | $location.hash(''); 13 | scope.$apply($anchorScroll); 14 | }); 15 | }; 16 | }]) 17 | 18 | 19 | .directive('code', function() { 20 | return { 21 | restrict: 'E', 22 | terminal: true, 23 | compile: function(element) { 24 | var linenums = element.hasClass('linenum');// || element.parent()[0].nodeName === 'PRE'; 25 | var match = /lang-(\S+)/.exec(element[0].className); 26 | var lang = match && match[1]; 27 | var html = element.html(); 28 | element.html(window.prettyPrintOne(html, lang, linenums)); 29 | } 30 | }; 31 | }) 32 | 33 | .directive('scrollYOffsetElement', ['$anchorScroll', function($anchorScroll) { 34 | return function(scope, element) { 35 | $anchorScroll.yOffset = element; 36 | }; 37 | }]); 38 | -------------------------------------------------------------------------------- /scripts/angular.js/untag-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Untags a release. 4 | 5 | echo "###################################" 6 | echo "## Untag angular.js for a release #" 7 | echo "###################################" 8 | 9 | ARG_DEFS=( 10 | "--action=(prepare|publish)" 11 | # the version number of the release. 12 | # e.g. 1.2.12 or 1.2.12-rc.1 13 | "--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)" 14 | ) 15 | 16 | function init { 17 | TMP_DIR=$(resolveDir ../../tmp) 18 | TAG_NAME="v$VERSION_NUMBER" 19 | } 20 | 21 | function prepare() { 22 | : 23 | } 24 | 25 | function publish() { 26 | # push the tag deletion to github 27 | tags=`git ls-remote --tags git@github.com:angular/angular.js` 28 | if [[ $tags =~ "refs/tags/v$VERSION_NUMBER^" ]]; then 29 | echo "-- Creating dummy git repo for angular.js with origin remote" 30 | mkdir $TMP_DIR/empty-angular.js 31 | cd $TMP_DIR/empty-angular.js 32 | git init 33 | git remote add origin git@github.com:angular/angular.js.git 34 | git push origin ":$TAG_NAME" 35 | else 36 | echo "-- Tag v$VERSION_NUMBER does not exist on remote. Moving on" 37 | fi 38 | } 39 | 40 | source $(dirname $0)/../utils.inc 41 | -------------------------------------------------------------------------------- /docs/app/test/directivesSpec.js: -------------------------------------------------------------------------------- 1 | describe("code", function() { 2 | var prettyPrintOne, oldPP; 3 | var compile, scope; 4 | 5 | var any = jasmine.any; 6 | 7 | beforeEach(module('directives')); 8 | 9 | beforeEach(inject(function($rootScope, $compile) { 10 | // Provide stub for pretty print function 11 | oldPP = window.prettyPrintOne; 12 | prettyPrintOne = window.prettyPrintOne = jasmine.createSpy(); 13 | 14 | scope = $rootScope.$new(); 15 | compile = $compile; 16 | })); 17 | 18 | afterEach(function() { 19 | window.prettyPrintOne = oldPP; 20 | }); 21 | 22 | 23 | it('should pretty print innerHTML', function() { 24 | compile('var x;')(scope); 25 | expect(prettyPrintOne).toHaveBeenCalledWith('var x;', null, false); 26 | }); 27 | 28 | it('should allow language declaration', function() { 29 | compile('')(scope); 30 | expect(prettyPrintOne).toHaveBeenCalledWith(any(String), 'javascript', false); 31 | }); 32 | 33 | it('supports allow line numbers', function() { 34 | compile('')(scope); 35 | expect(prettyPrintOne).toHaveBeenCalledWith(any(String), null, true); 36 | }); 37 | }); 38 | 39 | -------------------------------------------------------------------------------- /test/ngScenario/output/objectSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('angular.scenario.output.object', function() { 4 | var output; 5 | var runner, model, $window; 6 | var spec, step; 7 | 8 | beforeEach(function() { 9 | $window = {}; 10 | runner = new angular.scenario.testing.MockRunner(); 11 | model = new angular.scenario.ObjectModel(runner); 12 | runner.$window = $window; 13 | output = angular.scenario.output.object(null, runner, model); 14 | spec = { 15 | name: 'test spec', 16 | definition: { 17 | id: 10, 18 | name: 'describe', 19 | children: [] 20 | } 21 | }; 22 | step = { 23 | name: 'some step', 24 | line: function() { return 'unknown:-1'; } 25 | }; 26 | }); 27 | 28 | it('should create a global variable $result', function() { 29 | expect($window.$result).toBeDefined(); 30 | }); 31 | 32 | it('should maintain live state in $result', function() { 33 | runner.emit('SpecBegin', spec); 34 | runner.emit('StepBegin', spec, step); 35 | runner.emit('StepEnd', spec, step); 36 | 37 | expect($window.$result.children['describe'] 38 | .specs['test spec'].steps[0].duration).toBeDefined(); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /docs/config/processors/index-page.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _ = require('lodash'); 4 | var path = require('canonical-path'); 5 | 6 | /** 7 | * @dgProcessor generateIndexPagesProcessor 8 | * @description 9 | * This processor creates docs that will be rendered as the index page for the app 10 | */ 11 | module.exports = function generateIndexPagesProcessor() { 12 | return { 13 | deployments: [], 14 | $validate: { 15 | deployments: { presence: true } 16 | }, 17 | $runAfter: ['adding-extra-docs'], 18 | $runBefore: ['extra-docs-added'], 19 | $process: function(docs) { 20 | 21 | // Collect up all the areas in the docs 22 | var areas = {}; 23 | docs.forEach(function(doc) { 24 | if ( doc.area ) { 25 | areas[doc.area] = doc.area; 26 | } 27 | }); 28 | areas = _.keys(areas); 29 | 30 | this.deployments.forEach(function(deployment) { 31 | 32 | var indexDoc = _.defaults({ 33 | docType: 'indexPage', 34 | areas: areas 35 | }, deployment); 36 | 37 | indexDoc.id = 'index' + (deployment.name === 'default' ? '' : '-' + deployment.name); 38 | 39 | docs.push(indexDoc); 40 | }); 41 | } 42 | }; 43 | }; -------------------------------------------------------------------------------- /scripts/bower/unpublish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script for removing tags from the Angular bower repos 4 | 5 | echo "#################################" 6 | echo "#### Untag bower ################" 7 | echo "#################################" 8 | 9 | ARG_DEFS=( 10 | "--action=(prepare|publish)" 11 | "--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)" 12 | ) 13 | 14 | function init { 15 | TMP_DIR=$(resolveDir ../../tmp) 16 | } 17 | 18 | function prepare { 19 | : 20 | } 21 | 22 | function publish { 23 | for repo in "${REPOS[@]}" 24 | do 25 | tags=`git ls-remote --tags git@github.com:angular/bower-$repo` 26 | if [[ $tags =~ "refs/tags/v$VERSION_NUMBER" ]]; then 27 | echo "-- Creating dummy git repo for bower-$repo with origin remote" 28 | mkdir $TMP_DIR/bower-$repo 29 | cd $TMP_DIR/bower-$repo 30 | git init 31 | git remote add origin git@github.com:angular/bower-$repo.git 32 | git push origin :v$VERSION_NUMBER 33 | echo "-- Deleting v$VERSION_NUMBER tag from bower-$repo" 34 | cd $SCRIPT_DIR 35 | else 36 | echo "-- No remote tag matching v$VERSION_NUMBER exists on bower-$repo" 37 | fi 38 | done 39 | } 40 | 41 | source $(dirname $0)/repos.inc 42 | source $(dirname $0)/../utils.inc 43 | -------------------------------------------------------------------------------- /scripts/travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export BROWSER_STACK_ACCESS_KEY=`echo $BROWSER_STACK_ACCESS_KEY | rev` 6 | export SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev` 7 | 8 | if [ $JOB = "unit" ]; then 9 | if [ "$BROWSER_PROVIDER" == "browserstack" ]; then 10 | BROWSERS="BS_Chrome,BS_Safari,BS_Firefox,BS_IE_9,BS_IE_10,BS_IE_11,BS_iOS" 11 | else 12 | BROWSERS="SL_Chrome,SL_Safari,SL_Firefox,SL_IE_9,SL_IE_10,SL_IE_11,SL_iOS" 13 | fi 14 | 15 | grunt test:promises-aplus 16 | grunt test:unit --browsers $BROWSERS --reporters dots 17 | grunt ci-checks 18 | grunt tests:docs --browsers $BROWSERS --reporters dots 19 | elif [ $JOB = "docs-e2e" ]; then 20 | grunt test:travis-protractor --specs "docs/app/e2e/**/*.scenario.js" 21 | elif [ $JOB = "e2e" ]; then 22 | if [ $TEST_TARGET = "jquery" ]; then 23 | export USE_JQUERY=1 24 | fi 25 | 26 | export TARGET_SPECS="build/docs/ptore2e/**/default_test.js" 27 | if [ $TEST_TARGET = "jquery" ]; then 28 | TARGET_SPECS="build/docs/ptore2e/**/jquery_test.js" 29 | fi 30 | 31 | export TARGET_SPECS="test/e2e/tests/**/*.js,$TARGET_SPECS" 32 | grunt test:travis-protractor --specs "$TARGET_SPECS" 33 | else 34 | echo "Unknown job type. Please set JOB=unit or JOB=e2e-*." 35 | fi 36 | -------------------------------------------------------------------------------- /scripts/npm/clean-shrinkwrap.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * this script is just a temporary solution to deal with the issue of npm outputting the npm 5 | * shrinkwrap file in an unstable manner. 6 | * 7 | * See: https://github.com/npm/npm/issues/3581 8 | */ 9 | 10 | var _ = require('lodash'); 11 | var sorted = require('sorted-object'); 12 | var fs = require('fs'); 13 | var path = require('path'); 14 | 15 | 16 | function cleanModule(module, name) { 17 | 18 | // keep `resolve` properties for git dependencies, delete otherwise 19 | delete module.from; 20 | if (!(module.resolved && module.resolved.match(/^git(\+[a-z]+)?:\/\//))) { 21 | delete module.resolved; 22 | } 23 | 24 | _.forEach(module.dependencies, function(mod, name) { 25 | cleanModule(mod, name); 26 | }); 27 | } 28 | 29 | 30 | console.log('Reading npm-shrinkwrap.json'); 31 | var shrinkwrap = require('../../npm-shrinkwrap.json'); 32 | 33 | console.log('Cleaning shrinkwrap object'); 34 | cleanModule(shrinkwrap, shrinkwrap.name); 35 | 36 | var cleanShrinkwrapPath = path.join(__dirname, '..', '..', 'npm-shrinkwrap.clean.json'); 37 | console.log('Writing cleaned to', cleanShrinkwrapPath); 38 | fs.writeFileSync(cleanShrinkwrapPath, JSON.stringify(sorted(shrinkwrap), null, 2) + "\n"); 39 | -------------------------------------------------------------------------------- /src/ngScenario/matchers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Matchers for implementing specs. Follows the Jasmine spec conventions. 5 | */ 6 | 7 | angular.scenario.matcher('toEqual', function(expected) { 8 | return angular.equals(this.actual, expected); 9 | }); 10 | 11 | angular.scenario.matcher('toBe', function(expected) { 12 | return this.actual === expected; 13 | }); 14 | 15 | angular.scenario.matcher('toBeDefined', function() { 16 | return angular.isDefined(this.actual); 17 | }); 18 | 19 | angular.scenario.matcher('toBeTruthy', function() { 20 | return this.actual; 21 | }); 22 | 23 | angular.scenario.matcher('toBeFalsy', function() { 24 | return !this.actual; 25 | }); 26 | 27 | angular.scenario.matcher('toMatch', function(expected) { 28 | return new RegExp(expected).test(this.actual); 29 | }); 30 | 31 | angular.scenario.matcher('toBeNull', function() { 32 | return this.actual === null; 33 | }); 34 | 35 | angular.scenario.matcher('toContain', function(expected) { 36 | return includes(this.actual, expected); 37 | }); 38 | 39 | angular.scenario.matcher('toBeLessThan', function(expected) { 40 | return this.actual < expected; 41 | }); 42 | 43 | angular.scenario.matcher('toBeGreaterThan', function(expected) { 44 | return this.actual > expected; 45 | }); 46 | -------------------------------------------------------------------------------- /docs/config/templates/runnableExample.template.html: -------------------------------------------------------------------------------- 1 | {# Be aware that we need these extra new lines here or marked will not realise that the
2 | is HTML and wrap each line in a

- thus breaking the HTML #} 3 | 4 |

5 | 6 |   7 | Edit in Plunker 8 | 9 |
13 | 14 | {% for fileName, file in doc.example.files %} 15 |
17 | {% code -%} 18 | {$ file.fileContents $} 19 | {%- endcode %} 20 |
21 | {% endfor %} 22 | 23 | 24 |
25 |
26 | 27 | {# Be aware that we need these extra new lines here or marked will not realise that the
28 | above is HTML and wrap each line in a

- thus breaking the HTML #} 29 | -------------------------------------------------------------------------------- /scripts/jenkins/undo-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "#################################" 4 | echo "#### undo a release ############" 5 | echo "#################################" 6 | 7 | ARG_DEFS=( 8 | # require the git dryrun flag so the script can't be run without 9 | # thinking about this! 10 | "--git-push-dryrun=(true|false)" 11 | # the version number of the release. 12 | # e.g. 1.2.12 or 1.2.12-rc.1 13 | "--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)" 14 | ) 15 | 16 | function init { 17 | if [[ ! $VERBOSE ]]; then 18 | VERBOSE=false 19 | fi 20 | VERBOSE_ARG="--verbose=$VERBOSE" 21 | } 22 | 23 | function phase { 24 | ACTION_ARG="--action=$1" 25 | VERSION_NUMBER_ARG="--version-number=$VERSION_NUMBER" 26 | ../angular.js/untag-release.sh $ACTION_ARG $VERBOSE_ARG\ 27 | --version-number=$VERSION_NUMBER 28 | 29 | ../code.angularjs.org/unpublish.sh $ACTION_ARG $VERSION_NUMBER_ARG $VERBOSE_ARG 30 | ../bower/unpublish.sh $ACTION_ARG $VERSION_NUMBER_ARG $VERBOSE_ARG 31 | } 32 | 33 | function run { 34 | # First prepare all scripts (build, commit, tag, ...), 35 | # so we are sure everything is all right 36 | phase prepare 37 | # only then publish to github 38 | phase publish 39 | } 40 | 41 | source $(dirname $0)/../utils.inc 42 | -------------------------------------------------------------------------------- /test/ng/directive/ngKeySpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngKeyup and ngKeydown directives', function() { 4 | var element; 5 | 6 | afterEach(function() { 7 | dealoc(element); 8 | }); 9 | 10 | it('should get called on a keyup', inject(function($rootScope, $compile) { 11 | element = $compile('')($rootScope); 12 | $rootScope.$digest(); 13 | expect($rootScope.touched).toBeFalsy(); 14 | 15 | browserTrigger(element, 'keyup'); 16 | expect($rootScope.touched).toEqual(true); 17 | })); 18 | 19 | it('should get called on a keydown', inject(function($rootScope, $compile) { 20 | element = $compile('')($rootScope); 21 | $rootScope.$digest(); 22 | expect($rootScope.touched).toBeFalsy(); 23 | 24 | browserTrigger(element, 'keydown'); 25 | expect($rootScope.touched).toEqual(true); 26 | })); 27 | 28 | it('should get called on a keypress', inject(function($rootScope, $compile) { 29 | element = $compile('')($rootScope); 30 | $rootScope.$digest(); 31 | expect($rootScope.touched).toBeFalsy(); 32 | 33 | browserTrigger(element, 'keypress'); 34 | expect($rootScope.touched).toEqual(true); 35 | })); 36 | 37 | }); 38 | 39 | -------------------------------------------------------------------------------- /jenkins_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "#################################" 4 | echo "#### Jenkins Build ############" 5 | echo "#################################" 6 | 7 | # Enable tracing and exit on first failure 8 | set -xe 9 | 10 | # This is the default set of browsers to use on the CI server unless overridden via env variable 11 | if [[ -z "$BROWSERS" ]] 12 | then 13 | BROWSERS="Chrome,Firefox,Opera,/Users/jenkins/bin/safari.sh" 14 | fi 15 | 16 | # CLEAN # 17 | rm -f angular.min.js.gzip.size 18 | rm -f angular.js.size 19 | 20 | 21 | # BUILD # 22 | npm install --color false 23 | grunt ci-checks package --no-color 24 | 25 | mkdir -p test_out 26 | 27 | # UNIT TESTS # 28 | grunt test:unit --browsers $BROWSERS --reporters=dots,junit --no-colors --no-color 29 | 30 | # END TO END TESTS # 31 | grunt test:ci-protractor 32 | 33 | # DOCS APP TESTS # 34 | grunt test:docs --browsers $BROWSERS --reporters=dots,junit --no-colors --no-color 35 | 36 | # Promises/A+ TESTS # 37 | grunt test:promises-aplus --no-color 38 | 39 | 40 | # CHECK SIZE # 41 | gzip -c < build/angular.min.js > build/angular.min.js.gzip 42 | echo "YVALUE=`ls -l build/angular.min.js | cut -d" " -f 8`" > angular.min.js.size 43 | echo "YVALUE=`ls -l build/angular.min.js.gzip | cut -d" " -f 8`" > angular.min.js.gzip.size 44 | -------------------------------------------------------------------------------- /docs/app/test/docsSpec.js: -------------------------------------------------------------------------------- 1 | describe("DocsController", function() { 2 | var $scope; 3 | 4 | angular.module('fake', []) 5 | .value('$cookies', {}) 6 | .value('openPlunkr', function() {}) 7 | .value('NG_PAGES', {}) 8 | .value('NG_NAVIGATION', {}) 9 | .value('NG_VERSION', {}); 10 | 11 | beforeEach(module('fake', 'DocsController')); 12 | beforeEach(inject(function($rootScope, $controller) { 13 | $scope = $rootScope; 14 | $controller('DocsController', { $scope: $scope }); 15 | })); 16 | 17 | 18 | describe('afterPartialLoaded', function() { 19 | it("should update the Google Analytics with currentPage path if currentPage exists", inject(function($window) { 20 | $window._gaq = []; 21 | $scope.currentPage = { path: 'a/b/c' }; 22 | $scope.$broadcast('$includeContentLoaded'); 23 | expect($window._gaq.pop()).toEqual(['_trackPageview', 'a/b/c']); 24 | })); 25 | 26 | 27 | it("should update the Google Analytics with $location.path if currentPage is missing", inject(function($window, $location) { 28 | $window._gaq = []; 29 | spyOn($location, 'path').andReturn('x/y/z'); 30 | $scope.$broadcast('$includeContentLoaded'); 31 | expect($window._gaq.pop()).toEqual(['_trackPageview', 'x/y/z']); 32 | })); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /test/ng/filterSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$filter', function() { 4 | var $filterProvider, $filter; 5 | 6 | beforeEach(module(function(_$filterProvider_) { 7 | $filterProvider = _$filterProvider_; 8 | })); 9 | 10 | beforeEach(inject(function(_$filter_) { 11 | $filter = _$filter_; 12 | })); 13 | 14 | describe('provider', function() { 15 | it('should allow registration of filters', function() { 16 | var FooFilter = function() { 17 | return function() { return 'foo'; }; 18 | }; 19 | 20 | $filterProvider.register('foo', FooFilter); 21 | 22 | var fooFilter = $filter('foo'); 23 | expect(fooFilter()).toBe('foo'); 24 | }); 25 | 26 | it('should allow registration of a map of filters', function() { 27 | var FooFilter = function() { 28 | return function() { return 'foo'; }; 29 | }; 30 | 31 | var BarFilter = function() { 32 | return function() { return 'bar'; }; 33 | }; 34 | 35 | $filterProvider.register({ 36 | 'foo': FooFilter, 37 | 'bar': BarFilter 38 | }); 39 | 40 | var fooFilter = $filter('foo'); 41 | expect(fooFilter()).toBe('foo'); 42 | 43 | var barFilter = $filter('bar'); 44 | expect(barFilter()).toBe('bar'); 45 | }); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /test/ng/directive/ngSrcsetSpec.js: -------------------------------------------------------------------------------- 1 | /*jshint scripturl:true*/ 2 | 'use strict'; 3 | 4 | describe('ngSrcset', function() { 5 | var element; 6 | 7 | afterEach(function() { 8 | dealoc(element); 9 | }); 10 | 11 | it('should not result empty string in img srcset', inject(function($rootScope, $compile) { 12 | $rootScope.image = {}; 13 | element = $compile('')($rootScope); 14 | $rootScope.$digest(); 15 | expect(element.attr('srcset')).toBeUndefined(); 16 | })); 17 | 18 | it('should sanitize good urls', inject(function($rootScope, $compile) { 19 | $rootScope.imageUrl = 'http://example.com/image1.png 1x, http://example.com/image2.png 2x'; 20 | element = $compile('')($rootScope); 21 | $rootScope.$digest(); 22 | expect(element.attr('srcset')).toBe('http://example.com/image1.png 1x,http://example.com/image2.png 2x'); 23 | })); 24 | 25 | it('should sanitize evil url', inject(function($rootScope, $compile) { 26 | $rootScope.imageUrl = 'http://example.com/image1.png 1x, javascript:doEvilStuff() 2x'; 27 | element = $compile('')($rootScope); 28 | $rootScope.$digest(); 29 | expect(element.attr('srcset')).toBe('http://example.com/image1.png 1x,unsafe:javascript:doEvilStuff() 2x'); 30 | })); 31 | }); 32 | 33 | -------------------------------------------------------------------------------- /scripts/code.angularjs.org/unpublish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script for removing specified release dir from code.angularjs.org. 4 | 5 | echo "################################################" 6 | echo "## Remove a version from code.angular.js.org ###" 7 | echo "################################################" 8 | 9 | ARG_DEFS=( 10 | "--action=(prepare|publish)" 11 | "--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)" 12 | ) 13 | 14 | function init { 15 | TMP_DIR=$(resolveDir ../../tmp) 16 | REPO_DIR=$TMP_DIR/code.angularjs.org 17 | echo "code tmp $TMP_DIR" 18 | } 19 | 20 | function prepare { 21 | echo "-- Cloning code.angularjs.org" 22 | git clone git@github.com:angular/code.angularjs.org.git $REPO_DIR 23 | 24 | # 25 | # Remove the files from the repo 26 | # 27 | echo "-- Removing $VERSION_NUMBER from code.angularjs.org" 28 | cd $REPO_DIR 29 | if [ -d "$VERSION_NUMBER" ]; then 30 | git rm -r $VERSION_NUMBER 31 | echo "-- Committing removal to code.angularjs.org" 32 | git commit -m "removing v$VERSION_NUMBER" 33 | else 34 | echo "-- Version: $VERSION_NUMBER does not exist in code.angularjs.org!" 35 | fi 36 | } 37 | 38 | function publish { 39 | cd $REPO_DIR 40 | 41 | echo "-- Pushing code.angularjs.org to github" 42 | git push origin master 43 | } 44 | 45 | source $(dirname $0)/../utils.inc 46 | -------------------------------------------------------------------------------- /src/ng/directive/a.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name a 6 | * @restrict E 7 | * 8 | * @description 9 | * Modifies the default behavior of the html A tag so that the default action is prevented when 10 | * the href attribute is empty. 11 | * 12 | * This change permits the easy creation of action links with the `ngClick` directive 13 | * without changing the location or causing page reloads, e.g.: 14 | * `Add Item` 15 | */ 16 | var htmlAnchorDirective = valueFn({ 17 | restrict: 'E', 18 | compile: function(element, attr) { 19 | if (!attr.href && !attr.xlinkHref) { 20 | return function(scope, element) { 21 | // If the linked element is not an anchor tag anymore, do nothing 22 | if (element[0].nodeName.toLowerCase() !== 'a') return; 23 | 24 | // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. 25 | var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? 26 | 'xlink:href' : 'href'; 27 | element.on('click', function(event) { 28 | // if we have no href url, then don't navigate anywhere. 29 | if (!element.attr(href)) { 30 | event.preventDefault(); 31 | } 32 | }); 33 | }; 34 | } 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /src/ng/directive/ngNonBindable.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ngNonBindable 6 | * @restrict AC 7 | * @priority 1000 8 | * 9 | * @description 10 | * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current 11 | * DOM element. This is useful if the element contains what appears to be Angular directives and 12 | * bindings but which should be ignored by Angular. This could be the case if you have a site that 13 | * displays snippets of code, for instance. 14 | * 15 | * @element ANY 16 | * 17 | * @example 18 | * In this example there are two locations where a simple interpolation binding (`{{}}`) is present, 19 | * but the one wrapped in `ngNonBindable` is left alone. 20 | * 21 | * @example 22 | 23 | 24 |

Normal: {{1 + 2}}
25 |
Ignored: {{1 + 2}}
26 | 27 | 28 | it('should check ng-non-bindable', function() { 29 | expect(element(by.binding('1 + 2')).getText()).toContain('3'); 30 | expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/); 31 | }); 32 | 33 | 34 | */ 35 | var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 }); 36 | -------------------------------------------------------------------------------- /docs/content/error/$controller/ctrlfmt.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $controller:ctrlfmt 3 | @fullName Badly formed controller string 4 | @description 5 | 6 | This error occurs when {@link ng.$controller $controller} service is called 7 | with a string that does not match the supported controller string formats. 8 | 9 | Supported formats: 10 | 11 | 1. `__name__` 12 | 2. `__name__ as __identifier__` 13 | 14 | Neither `__name__` or `__identifier__` may contain spaces. 15 | 16 | Example of incorrect usage that leads to this error: 17 | ```html 18 | 19 |
` tag, loader like 11 | require.js, or testing harness like karma). 12 | 13 | A less common reason for this error is trying to "re-open" a module that has not yet been defined. 14 | 15 | To define a new module, call {@link angular.module angular.module} with a name 16 | and an array of dependent modules, like so: 17 | 18 | ```js 19 | // When defining a module with no module dependencies, 20 | // the array of dependencies should be defined and empty. 21 | var myApp = angular.module('myApp', []); 22 | ``` 23 | 24 | To retrieve a reference to the same module for further configuration, call 25 | `angular.module` without the array argument. 26 | 27 | ```js 28 | var myApp = angular.module('myApp'); 29 | ``` 30 | 31 | Calling `angular.module` without the array of dependencies when the module has not yet been defined 32 | causes this error to be thrown. To fix it, define your module with a name and an empty array, as in 33 | the first example above. 34 | -------------------------------------------------------------------------------- /lib/browserstack/start_tunnel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var fs = require('fs'); 4 | var http = require('http'); 5 | var BrowserStackTunnel = require('browserstacktunnel-wrapper'); 6 | 7 | var HOSTNAME = 'localhost'; 8 | var PORTS = [9876, 8000]; 9 | var ACCESS_KEY = process.env.BROWSER_STACK_ACCESS_KEY; 10 | var READY_FILE = process.env.BROWSER_PROVIDER_READY_FILE; 11 | var TUNNEL_IDENTIFIER = process.env.TRAVIS_JOB_NUMBER; 12 | 13 | // We need to start fake servers, otherwise the tunnel does not start. 14 | var fakeServers = []; 15 | var hosts = []; 16 | 17 | PORTS.forEach(function(port) { 18 | fakeServers.push(http.createServer(function() {}).listen(port)); 19 | hosts.push({ 20 | name: HOSTNAME, 21 | port: port, 22 | sslFlag: 0 23 | }); 24 | }); 25 | 26 | var tunnel = new BrowserStackTunnel({ 27 | key: ACCESS_KEY, 28 | tunnelIdentifier: TUNNEL_IDENTIFIER, 29 | hosts: hosts 30 | }); 31 | 32 | console.log('Starting tunnel on ports', PORTS.join(', ')); 33 | tunnel.start(function(error) { 34 | if (error) { 35 | console.error('Can not establish the tunnel', error); 36 | } else { 37 | console.log('Tunnel established.'); 38 | fakeServers.forEach(function(server) { 39 | server.close(); 40 | }); 41 | 42 | if (READY_FILE) { 43 | fs.writeFile(READY_FILE, ''); 44 | } 45 | } 46 | }); 47 | 48 | tunnel.on('error', function(error) { 49 | console.error(error); 50 | }); 51 | -------------------------------------------------------------------------------- /docs/content/tutorial/step_01.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc tutorial 2 | @name 1 - Static Template 3 | @step 1 4 | @description 5 | 6 |
    7 | 8 | 9 | In order to illustrate how Angular enhances standard HTML, you will create a purely *static* HTML 10 | page and then examine how we can turn this HTML code into a template that Angular will use to 11 | dynamically display the same result with any set of data. 12 | 13 | In this step you will add some basic information about two cell phones to an HTML page. 14 | 15 | - The page now contains a list with information about two phones. 16 | 17 |
    18 | 19 | 20 | **`app/index.html`:** 21 | 22 | ```html 23 |
      24 |
    • 25 | Nexus S 26 |

      27 | Fast just got faster with Nexus S. 28 |

      29 |
    • 30 |
    • 31 | Motorola XOOM™ with Wi-Fi 32 |

      33 | The Next, Next Generation tablet. 34 |

      35 |
    • 36 |
    37 | ``` 38 | 39 | 40 | # Experiments 41 | 42 | * Try adding more static HTML to `index.html`. For example: 43 | 44 |

    Total number of phones: 2

    45 | 46 | 47 | # Summary 48 | 49 | This addition to your app uses static HTML to display the list. Now, let's go to {@link step_02 50 | step 2} to learn how to use AngularJS to dynamically generate the same list. 51 | 52 | 53 |
      54 | -------------------------------------------------------------------------------- /test/ng/directive/scriptSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('scriptDirective', function() { 4 | var element; 5 | 6 | 7 | afterEach(function() { 8 | dealoc(element); 9 | }); 10 | 11 | 12 | it('should populate $templateCache with contents of a ng-template script element', inject( 13 | function($compile, $templateCache) { 14 | $compile('
      foo' + 15 | '' + 16 | '' + 17 | '
      '); 18 | expect($templateCache.get('/myTemplate.html')).toBe('{{y}}'); 19 | expect($templateCache.get('/ignore')).toBeUndefined(); 20 | } 21 | )); 22 | 23 | 24 | it('should not compile scripts', inject(function($compile, $templateCache, $rootScope) { 25 | var doc = jqLite('
      '); 26 | // jQuery is too smart and removes script tags 27 | doc[0].innerHTML = 'foo' + 28 | '' + 29 | ''; 30 | 31 | $compile(doc)($rootScope); 32 | $rootScope.$digest(); 33 | 34 | var scripts = doc.find('script'); 35 | expect(scripts.eq(0)[0].text).toBe('some {{binding}}'); 36 | expect(scripts.eq(1)[0].text).toBe('other {{binding}}'); 37 | dealoc(doc); 38 | })); 39 | }); 40 | -------------------------------------------------------------------------------- /lib/promises-aplus/promises-aplus-test-adapter.js: -------------------------------------------------------------------------------- 1 | /* global qFactory: false */ 2 | 'use strict'; 3 | 4 | var isFunction = function isFunction(value){return typeof value == 'function';}; 5 | var isPromiseLike = function isPromiseLike(obj) {return obj && isFunction(obj.then);}; 6 | var isObject = function isObject(value){return value != null && typeof value === 'object';}; 7 | var isUndefined = function isUndefined(value) {return typeof value === 'undefined';}; 8 | 9 | var minErr = function minErr (module, constructor) { 10 | return function (){ 11 | var ErrorConstructor = constructor || Error; 12 | throw new ErrorConstructor(module + arguments[0] + arguments[1]); 13 | }; 14 | }; 15 | 16 | var extend = function extend(dst) { 17 | for (var i = 1, ii = arguments.length; i < ii; i++) { 18 | var obj = arguments[i]; 19 | if (obj) { 20 | var keys = Object.keys(obj); 21 | for (var j = 0, jj = keys.length; j < jj; j++) { 22 | var key = keys[j]; 23 | dst[key] = obj[key]; 24 | } 25 | } 26 | } 27 | return dst; 28 | }; 29 | 30 | var $q = qFactory(process.nextTick, function noopExceptionHandler() {}); 31 | 32 | exports.resolved = $q.resolve; 33 | exports.rejected = $q.reject; 34 | exports.deferred = function () { 35 | var deferred = $q.defer(); 36 | 37 | return { 38 | promise: deferred.promise, 39 | resolve: deferred.resolve, 40 | reject: deferred.reject 41 | }; 42 | }; 43 | -------------------------------------------------------------------------------- /docs/content/error/ngRepeat/badident.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name ngRepeat:badident 3 | @fullName Invalid identifier expression 4 | @description 5 | 6 | Occurs when an invalid identifier is specified in an {@link ng.directive:ngRepeat ngRepeat} expression. 7 | 8 | The {@link ng.directive:ngRepeat ngRepeat} directive's `alias as` syntax is used to assign an alias for the processed collection in scope. 9 | 10 | If the expression is not a simple identifier (such that you could declare it with `var {name}`, or if the expression is a reserved name, 11 | this error is thrown. 12 | 13 | Reserved names include: 14 | 15 | - `null` 16 | - `this` 17 | - `undefined` 18 | - `$parent` 19 | - `$id` 20 | - `$root` 21 | - `$even` 22 | - `$odd` 23 | - `$first` 24 | - `$last` 25 | - `$middle` 26 | 27 | Invalid expressions might look like this: 28 | 29 | ```html 30 |
    • {{item}}
    • 31 |
    • {{item}}
    • 32 |
    • {{item}}
    • 33 |
    • {{item}}
    • 34 | ``` 35 | 36 | Valid expressions might look like this: 37 | 38 | ```html 39 |
    • {{item}}
    • 40 |
    • {{item}}
    • 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/config/services/deployments/debug.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = function debugDeployment(getVersion) { 4 | return { 5 | name: 'debug', 6 | examples: { 7 | commonFiles: { 8 | scripts: [ '../../../angular.js' ] 9 | }, 10 | dependencyPath: '../../../' 11 | }, 12 | scripts: [ 13 | '../angular.js', 14 | '../angular-resource.js', 15 | '../angular-route.js', 16 | '../angular-cookies.js', 17 | '../angular-sanitize.js', 18 | '../angular-touch.js', 19 | '../angular-animate.js', 20 | 'components/marked-' + getVersion('marked', 'node_modules', 'package.json') + '/lib/marked.js', 21 | 'js/angular-bootstrap/bootstrap.js', 22 | 'js/angular-bootstrap/dropdown-toggle.js', 23 | 'components/lunr.js-' + getVersion('lunr.js') + '/lunr.js', 24 | 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', 25 | 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js', 26 | 'js/versions-data.js', 27 | 'js/pages-data.js', 28 | 'js/nav-data.js', 29 | 'js/docs.js' 30 | ], 31 | stylesheets: [ 32 | 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.css', 33 | 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 34 | 'css/prettify-theme.css', 35 | 'css/docs.css', 36 | 'css/animations.css' 37 | ] 38 | }; 39 | }; -------------------------------------------------------------------------------- /test/e2e/tools/middleware.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var url = require('url'); 4 | var util = require('./util'); 5 | var fixture = require('./fixture'); 6 | 7 | module.exports = middlewareFactory; 8 | 9 | function middlewareFactory(base) { 10 | base = base || '/e2e'; 11 | while (base.length && base[base.length - 1] === '/') base = base.slice(0, base.length - 1); 12 | var fixture_regexp = new RegExp('^' + base + '/fixtures/([a-zA-Z0-9_-]+)(/(index.html)?)?$'); 13 | var static_regexp = new RegExp('^' + base + '/fixtures/([a-zA-Z0-9_-]+)(/.*)$'); 14 | 15 | return function(req, res, next) { 16 | var match; 17 | var basicUrl = req.url; 18 | var idx = basicUrl.indexOf('?'); 19 | if (idx >= 0) { 20 | basicUrl = basicUrl.slice(0, idx); 21 | } 22 | if ((match = fixture_regexp.exec(basicUrl))) { 23 | if (util.testExists(match[1])) { 24 | try { 25 | var query = url.parse(req.url, true).query; 26 | res.write(fixture.generate(match[1], query)); 27 | res.end(); 28 | } catch (e) { 29 | return next(e); 30 | } 31 | } else { 32 | return next('Fixture ' + match[1] + ' not found.'); 33 | } 34 | } else if ((match = static_regexp.exec(basicUrl))) { 35 | var rewritten = util.rewriteTestFile(match[1], match[2]); 36 | if (rewritten !== false) { 37 | req.url = rewritten; 38 | } 39 | next(); 40 | } else { 41 | return next(); 42 | } 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /docs/content/guide/ie.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Internet Explorer Compatibility 3 | @sortOrder 530 4 | @description 5 | 6 | # Internet Explorer Compatibility 7 | 8 |
      9 | **Note:** AngularJS 1.3 has dropped support for IE8. Read more about it on 10 | [our blog](http://blog.angularjs.org/2013/12/angularjs-13-new-release-approaches.html). 11 | AngularJS 1.2 will continue to support IE8, but the core team does not plan to spend time 12 | addressing issues specific to IE8 or earlier. 13 |
      14 | 15 | This document describes the Internet Explorer (IE) idiosyncrasies when dealing with custom HTML 16 | attributes and tags. Read this document if you are planning on deploying your Angular application 17 | on IE. 18 | 19 | The project currently supports and will attempt to fix bugs for IE9 and above. The continuous 20 | integration server runs all the tests against IE9, IE10, and IE11. See 21 | [Travis CI](https://travis-ci.org/angular/angular.js) and 22 | [ci.angularjs.org](http://ci.angularjs.org). 23 | 24 | We do not run tests on IE8 and below. A subset of the AngularJS functionality may work on these 25 | browsers, but it is up to you to test and decide whether it works for your particular app. 26 | 27 | 28 | To ensure your Angular application works on IE please consider: 29 | 30 | 1. Use `ng-style` tags instead of `style="{{ someCss }}"`. The latter works in Chrome and Firefox 31 | but does not work in Internet Explorer <= 11 (the most recent version at time of writing). -------------------------------------------------------------------------------- /src/ngAnimate/rafScheduler.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) { 4 | var queue, cancelFn; 5 | 6 | function scheduler(tasks) { 7 | // we make a copy since RAFScheduler mutates the state 8 | // of the passed in array variable and this would be difficult 9 | // to track down on the outside code 10 | queue = queue.concat(tasks); 11 | nextTick(); 12 | } 13 | 14 | queue = scheduler.queue = []; 15 | 16 | /* waitUntilQuiet does two things: 17 | * 1. It will run the FINAL `fn` value only when an uncancelled RAF has passed through 18 | * 2. It will delay the next wave of tasks from running until the quiet `fn` has run. 19 | * 20 | * The motivation here is that animation code can request more time from the scheduler 21 | * before the next wave runs. This allows for certain DOM properties such as classes to 22 | * be resolved in time for the next animation to run. 23 | */ 24 | scheduler.waitUntilQuiet = function(fn) { 25 | if (cancelFn) cancelFn(); 26 | 27 | cancelFn = $$rAF(function() { 28 | cancelFn = null; 29 | fn(); 30 | nextTick(); 31 | }); 32 | }; 33 | 34 | return scheduler; 35 | 36 | function nextTick() { 37 | if (!queue.length) return; 38 | 39 | var items = queue.shift(); 40 | for (var i = 0; i < items.length; i++) { 41 | items[i](); 42 | } 43 | 44 | if (!cancelFn) { 45 | $$rAF(function() { 46 | if (!cancelFn) nextTick(); 47 | }); 48 | } 49 | } 50 | }]; 51 | -------------------------------------------------------------------------------- /docs/content/error/$rootScope/infdig.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc error 2 | @name $rootScope:infdig 3 | @fullName Infinite $digest Loop 4 | @description 5 | 6 | This error occurs when the application's model becomes unstable and each `$digest` cycle triggers a state change and subsequent `$digest` cycle. 7 | Angular detects this situation and prevents an infinite loop from causing the browser to become unresponsive. 8 | 9 | For example, the situation can occur by setting up a watch on a path and subsequently updating the same path when the value changes. 10 | 11 | ``` 12 | $scope.$watch('foo', function() { 13 | $scope.foo = $scope.foo + 1; 14 | }); 15 | ``` 16 | 17 | One common mistake is binding to a function which generates a new array every time it is called. For example: 18 | 19 | ``` 20 |
      {{ user.name }}
      21 | 22 | ... 23 | 24 | $scope.getUsers = function() { 25 | return [ { name: 'Hank' }, { name: 'Francisco' } ]; 26 | }; 27 | ``` 28 | 29 | Since `getUsers()` returns a new array, Angular determines that the model is different on each `$digest` 30 | cycle, resulting in the error. The solution is to return the same array object if the elements have 31 | not changed: 32 | 33 | ``` 34 | var users = [ { name: 'Hank' }, { name: 'Francisco' } ]; 35 | 36 | $scope.getUsers = function() { 37 | return users; 38 | }; 39 | ``` 40 | 41 | The maximum number of allowed iterations of the `$digest` cycle is controlled via TTL setting which can be configured via {@link ng.$rootScopeProvider $rootScopeProvider}. 42 | -------------------------------------------------------------------------------- /docs/config/services/deployments/default.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = function defaultDeployment(getVersion) { 4 | return { 5 | name: 'default', 6 | examples: { 7 | commonFiles: { 8 | scripts: [ '../../../angular.min.js' ] 9 | }, 10 | dependencyPath: '../../../' 11 | }, 12 | scripts: [ 13 | '../angular.min.js', 14 | '../angular-resource.min.js', 15 | '../angular-route.min.js', 16 | '../angular-cookies.min.js', 17 | '../angular-sanitize.min.js', 18 | '../angular-touch.min.js', 19 | '../angular-animate.min.js', 20 | 'components/marked-' + getVersion('marked', 'node_modules', 'package.json') + '/lib/marked.js', 21 | 'js/angular-bootstrap/bootstrap.min.js', 22 | 'js/angular-bootstrap/dropdown-toggle.min.js', 23 | 'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js', 24 | 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', 25 | 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js', 26 | 'js/versions-data.js', 27 | 'js/pages-data.js', 28 | 'js/nav-data.js', 29 | 'js/docs.min.js' 30 | ], 31 | stylesheets: [ 32 | 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css', 33 | 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 34 | 'css/prettify-theme.css', 35 | 'css/docs.css', 36 | 'css/animations.css' 37 | ] 38 | }; 39 | }; -------------------------------------------------------------------------------- /test/ng/directive/ngInitSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngInit', function() { 4 | var element; 5 | 6 | 7 | afterEach(function() { 8 | dealoc(element); 9 | }); 10 | 11 | 12 | it("should init model", inject(function($rootScope, $compile) { 13 | element = $compile('
      ')($rootScope); 14 | expect($rootScope.a).toEqual(123); 15 | })); 16 | 17 | 18 | it("should be evaluated before ngInclude", inject(function($rootScope, $templateCache, $compile) { 19 | $templateCache.put('template1.tpl', '1'); 20 | $templateCache.put('template2.tpl', '2'); 21 | $rootScope.template = 'template1.tpl'; 22 | element = $compile('
      ')($rootScope); 24 | $rootScope.$digest(); 25 | expect($rootScope.template).toEqual('template2.tpl'); 26 | expect(element.find('span').text()).toEqual('2'); 27 | })); 28 | 29 | 30 | it("should be evaluated after ngController", function() { 31 | module(function($controllerProvider) { 32 | $controllerProvider.register('TestCtrl', function($scope) {}); 33 | }); 34 | inject(function($rootScope, $compile) { 35 | element = $compile('
      ')($rootScope); 37 | $rootScope.$digest(); 38 | expect($rootScope.test).toBeUndefined(); 39 | expect(element.children('div').scope().test).toEqual(123); 40 | }); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /test/ngScenario/ScenarioSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe("ScenarioSpec: Compilation", function() { 4 | var element; 5 | 6 | afterEach(function() { 7 | dealoc(element); 8 | }); 9 | 10 | 11 | describe('compilation', function() { 12 | it("should compile dom node and return scope", inject(function($rootScope, $compile) { 13 | var node = jqLite('
      {{b=a+1}}
      ')[0]; 14 | element = $compile(node)($rootScope); 15 | $rootScope.$digest(); 16 | expect($rootScope.a).toEqual(1); 17 | expect($rootScope.b).toEqual(2); 18 | })); 19 | 20 | it("should compile jQuery node and return scope", inject(function($rootScope, $compile) { 21 | element = $compile(jqLite('
      {{a=123}}
      '))($rootScope); 22 | $rootScope.$digest(); 23 | expect(jqLite(element).text()).toEqual('123'); 24 | })); 25 | 26 | it("should compile text node and return scope", inject(function($rootScope, $compile) { 27 | element = $compile('
      {{a=123}}
      ')($rootScope); 28 | $rootScope.$digest(); 29 | expect(jqLite(element).text()).toEqual('123'); 30 | })); 31 | }); 32 | 33 | describe('jQuery', function() { 34 | it('should exist on the angular.scenario object', function() { 35 | expect(angular.scenario.jQuery).toBeDefined(); 36 | }); 37 | 38 | it('should have common jQuery methods', function() { 39 | var jQuery = angular.scenario.jQuery; 40 | expect(typeof jQuery).toEqual('function'); 41 | expect(typeof jQuery('
      ').html).toEqual('function'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /benchmarks/event-delegation-bp/app.js: -------------------------------------------------------------------------------- 1 | var app = angular.module('eventDelegationBenchmark', []); 2 | 3 | app.directive('noopDir', function() { 4 | return { 5 | compile: function($element, $attrs) { 6 | return function($scope, $element) { 7 | return 1; 8 | } 9 | } 10 | }; 11 | }); 12 | 13 | app.directive('nativeClick', ['$parse', function($parse) { 14 | return { 15 | compile: function($element, $attrs) { 16 | var expr = $parse($attrs.tstEvent); 17 | return function($scope, $element) { 18 | $element[0].addEventListener('click', function() { 19 | console.log('clicked'); 20 | }, false); 21 | } 22 | } 23 | }; 24 | }]); 25 | 26 | app.directive('dlgtClick', function() { 27 | return { 28 | compile: function($element, $attrs) { 29 | var evt = $attrs.dlgtClick; 30 | // We don't setup the global event listeners as the costs are small and one time only... 31 | } 32 | }; 33 | }); 34 | 35 | app.controller('DataController', function($rootScope) { 36 | this.ngRepeatCount = 1000; 37 | this.rows = []; 38 | var self = this; 39 | 40 | benchmarkSteps.push({ 41 | name: '$apply', 42 | fn: function() { 43 | var oldRows = self.rows; 44 | $rootScope.$apply(function() { 45 | self.rows = []; 46 | }); 47 | self.rows = oldRows; 48 | if (self.rows.length !== self.ngRepeatCount) { 49 | self.rows = []; 50 | for (var i=0; i
      ')($rootScope); 16 | element = $compile('
      ' + 17 | ' {{a}}' + 18 | ' ' + 19 | '
      ' + 20 | ' {{b}}' + 21 | '
      ' + 22 | ' {{a}}' + 23 | ' ' + 24 | '
      ')($rootScope); 25 | $rootScope.a = "one"; 26 | $rootScope.b = "two"; 27 | $rootScope.$digest(); 28 | // Bindings not contained by ng-non-bindable should resolve. 29 | var spans = element.find("span"); 30 | expect(spans.eq(0).text()).toEqual('one'); 31 | expect(spans.eq(1).text()).toEqual('two'); 32 | expect(spans.eq(3).text()).toEqual('one'); 33 | expect(spans.eq(4).text()).toEqual('two'); 34 | // Bindings contained by ng-non-bindable should be left alone. 35 | var nonBindableDiv = element.find("div"); 36 | expect(nonBindableDiv.attr('foo')).toEqual('{{a}}'); 37 | expect(trim(nonBindableDiv.text())).toEqual('{{b}}'); 38 | })); 39 | }); 40 | -------------------------------------------------------------------------------- /test/ng/forceReflowSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$$forceReflow', function() { 4 | it('should issue a reflow by touching the `document.body.client` when no param is provided', function() { 5 | module(function($provide) { 6 | var doc = jqLite('
      '); 7 | doc[0].body = {}; 8 | doc[0].body.offsetWidth = 10; 9 | $provide.value('$document', doc); 10 | }); 11 | inject(function($$forceReflow) { 12 | var value = $$forceReflow(); 13 | expect(value).toBe(11); 14 | }); 15 | }); 16 | 17 | it('should issue a reflow by touching the `domNode.offsetWidth` when a domNode param is provided', 18 | inject(function($$forceReflow) { 19 | 20 | var elm = {}; 21 | elm.offsetWidth = 100; 22 | expect($$forceReflow(elm)).toBe(101); 23 | })); 24 | 25 | it('should issue a reflow by touching the `jqLiteNode[0].offsetWidth` when a jqLite node param is provided', 26 | inject(function($$forceReflow) { 27 | 28 | var elm = {}; 29 | elm.offsetWidth = 200; 30 | elm = jqLite(elm); 31 | expect($$forceReflow(elm)).toBe(201); 32 | })); 33 | 34 | describe('$animate with ngAnimateMock', function() { 35 | beforeEach(module('ngAnimateMock')); 36 | 37 | it('should keep track of how many reflows have been issued', 38 | inject(function($$forceReflow, $animate) { 39 | 40 | var elm = {}; 41 | elm.offsetWidth = 10; 42 | 43 | expect($animate.reflows).toBe(0); 44 | 45 | $$forceReflow(elm); 46 | $$forceReflow(elm); 47 | $$forceReflow(elm); 48 | 49 | expect($animate.reflows).toBe(3); 50 | })); 51 | }); 52 | }); 53 | -------------------------------------------------------------------------------- /test/ng/directive/ngCloakSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngCloak', function() { 4 | var element; 5 | 6 | 7 | afterEach(function() { 8 | dealoc(element); 9 | }); 10 | 11 | 12 | it('should get removed when an element is compiled', inject(function($rootScope, $compile) { 13 | element = jqLite('
      '); 14 | expect(element.attr('ng-cloak')).toBe(''); 15 | $compile(element); 16 | expect(element.attr('ng-cloak')).toBeUndefined(); 17 | })); 18 | 19 | 20 | it('should remove ngCloak class from a compiled element with attribute', inject( 21 | function($rootScope, $compile) { 22 | element = jqLite('
      '); 23 | 24 | expect(element.hasClass('foo')).toBe(true); 25 | expect(element.hasClass('ng-cloak')).toBe(true); 26 | expect(element.hasClass('bar')).toBe(true); 27 | 28 | $compile(element); 29 | 30 | expect(element.hasClass('foo')).toBe(true); 31 | expect(element.hasClass('ng-cloak')).toBe(false); 32 | expect(element.hasClass('bar')).toBe(true); 33 | })); 34 | 35 | 36 | it('should remove ngCloak class from a compiled element', inject(function($rootScope, $compile) { 37 | element = jqLite('
      '); 38 | 39 | expect(element.hasClass('foo')).toBe(true); 40 | expect(element.hasClass('ng-cloak')).toBe(true); 41 | expect(element.hasClass('bar')).toBe(true); 42 | 43 | $compile(element); 44 | 45 | expect(element.hasClass('foo')).toBe(true); 46 | expect(element.hasClass('ng-cloak')).toBe(false); 47 | expect(element.hasClass('bar')).toBe(true); 48 | })); 49 | }); 50 | -------------------------------------------------------------------------------- /src/ngRoute/routeParams.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | ngRouteModule.provider('$routeParams', $RouteParamsProvider); 4 | 5 | 6 | /** 7 | * @ngdoc service 8 | * @name $routeParams 9 | * @requires $route 10 | * 11 | * @description 12 | * The `$routeParams` service allows you to retrieve the current set of route parameters. 13 | * 14 | * Requires the {@link ngRoute `ngRoute`} module to be installed. 15 | * 16 | * The route parameters are a combination of {@link ng.$location `$location`}'s 17 | * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}. 18 | * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched. 19 | * 20 | * In case of parameter name collision, `path` params take precedence over `search` params. 21 | * 22 | * The service guarantees that the identity of the `$routeParams` object will remain unchanged 23 | * (but its properties will likely change) even when a route change occurs. 24 | * 25 | * Note that the `$routeParams` are only updated *after* a route change completes successfully. 26 | * This means that you cannot rely on `$routeParams` being correct in route resolve functions. 27 | * Instead you can use `$route.current.params` to access the new route's parameters. 28 | * 29 | * @example 30 | * ```js 31 | * // Given: 32 | * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby 33 | * // Route: /Chapter/:chapterId/Section/:sectionId 34 | * // 35 | * // Then 36 | * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'} 37 | * ``` 38 | */ 39 | function $RouteParamsProvider() { 40 | this.$get = function() { return {}; }; 41 | } 42 | -------------------------------------------------------------------------------- /docs/app/assets/js/search-worker.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /* jshint browser: true */ 3 | /* global importScripts, onmessage: true, postMessage, lunr */ 4 | 5 | // Load up the lunr library 6 | importScripts('../components/lunr.js-0.4.2/lunr.min.js'); 7 | 8 | // Create the lunr index - the docs should be an array of object, each object containing 9 | // the path and search terms for a page 10 | var index = lunr(function() { 11 | this.ref('path'); 12 | this.field('titleWords', {boost: 50}); 13 | this.field('members', { boost: 40}); 14 | this.field('keywords', { boost : 20 }); 15 | }); 16 | 17 | // Retrieve the searchData which contains the information about each page to be indexed 18 | var searchData = {}; 19 | var searchDataRequest = new XMLHttpRequest(); 20 | searchDataRequest.onload = function() { 21 | 22 | // Store the pages data to be used in mapping query results back to pages 23 | searchData = JSON.parse(this.responseText); 24 | // Add search terms from each page to the search index 25 | searchData.forEach(function(page) { 26 | index.add(page); 27 | }); 28 | postMessage({ e: 'index-ready' }); 29 | }; 30 | searchDataRequest.open('GET', 'search-data.json'); 31 | searchDataRequest.send(); 32 | 33 | // The worker receives a message everytime the web app wants to query the index 34 | onmessage = function(oEvent) { 35 | var q = oEvent.data.q; 36 | var hits = index.search(q); 37 | var results = []; 38 | // Only return the array of paths to pages 39 | hits.forEach(function(hit) { 40 | results.push(hit.ref); 41 | }); 42 | // The results of the query are sent back to the web app via a new message 43 | postMessage({ e: 'query-ready', q: q, d: results }); 44 | }; --------------------------------------------------------------------------------