├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── angularFiles.js ├── changelog.js ├── changelog.spec.js ├── changelog.tmp.md ├── check-size.sh ├── css ├── angular-scenario.css └── angular.css ├── docs ├── content │ ├── api │ │ ├── index.ngdoc │ │ └── ng.ngdoc │ ├── cookbook │ │ ├── advancedform.ngdoc │ │ ├── buzz.ngdoc │ │ ├── deeplinking.ngdoc │ │ ├── form.ngdoc │ │ ├── helloworld.ngdoc │ │ ├── index.ngdoc │ │ └── mvc.ngdoc │ ├── guide │ │ ├── bootstrap.ngdoc │ │ ├── compiler.ngdoc │ │ ├── concepts.ngdoc │ │ ├── dev_guide.e2e-testing.ngdoc │ │ ├── dev_guide.mvc.ngdoc │ │ ├── dev_guide.mvc.understanding_controller.ngdoc │ │ ├── dev_guide.mvc.understanding_model.ngdoc │ │ ├── dev_guide.mvc.understanding_view.ngdoc │ │ ├── dev_guide.services.$location.ngdoc │ │ ├── dev_guide.services.creating_services.ngdoc │ │ ├── dev_guide.services.injecting_controllers.ngdoc │ │ ├── dev_guide.services.managing_dependencies.ngdoc │ │ ├── dev_guide.services.ngdoc │ │ ├── dev_guide.services.testing_services.ngdoc │ │ ├── dev_guide.services.understanding_services.ngdoc │ │ ├── dev_guide.templates.css-styling.ngdoc │ │ ├── dev_guide.templates.databinding.ngdoc │ │ ├── dev_guide.templates.filters.creating_filters.ngdoc │ │ ├── dev_guide.templates.filters.ngdoc │ │ ├── dev_guide.templates.filters.using_filters.ngdoc │ │ ├── dev_guide.templates.ngdoc │ │ ├── dev_guide.unit-testing.ngdoc │ │ ├── di.ngdoc │ │ ├── directive.ngdoc │ │ ├── expression.ngdoc │ │ ├── forms.ngdoc │ │ ├── i18n.ngdoc │ │ ├── ie.ngdoc │ │ ├── index.ngdoc │ │ ├── introduction.ngdoc │ │ ├── module.ngdoc │ │ ├── overview.ngdoc │ │ ├── scope.ngdoc │ │ └── type.ngdoc │ ├── misc │ │ ├── contribute.ngdoc │ │ ├── downloading.ngdoc │ │ ├── faq.ngdoc │ │ └── started.ngdoc │ └── tutorial │ │ ├── index.ngdoc │ │ ├── step_00.ngdoc │ │ ├── step_01.ngdoc │ │ ├── step_02.ngdoc │ │ ├── step_03.ngdoc │ │ ├── step_04.ngdoc │ │ ├── step_05.ngdoc │ │ ├── step_06.ngdoc │ │ ├── step_07.ngdoc │ │ ├── step_08.ngdoc │ │ ├── step_09.ngdoc │ │ ├── step_10.ngdoc │ │ ├── step_11.ngdoc │ │ └── the_end.ngdoc ├── img │ ├── AngularJS-small.png │ ├── One_Way_Data_Binding.png │ ├── Two_Way_Data_Binding.png │ ├── angular_parts.png │ ├── bullet.png │ ├── form_data_flow.png │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ ├── guide │ │ ├── about_model_final.png │ │ ├── about_view_final.png │ │ ├── concepts-controller.png │ │ ├── concepts-directive.png │ │ ├── concepts-model.png │ │ ├── concepts-module-injector.png │ │ ├── concepts-runtime.png │ │ ├── concepts-scope.png │ │ ├── concepts-startup.png │ │ ├── concepts-view.png │ │ ├── di_sequence_final.png │ │ ├── dom_scope_final.png │ │ ├── hashbang_vs_regular_url.jpg │ │ ├── scenario_runner.png │ │ └── simple_scope_final.png │ ├── helloworld.png │ ├── helloworld_2way.png │ └── tutorial │ │ ├── catalog_screen.png │ │ ├── tutorial_00.png │ │ ├── tutorial_00_final.png │ │ ├── tutorial_02.png │ │ ├── tutorial_03.png │ │ ├── tutorial_04.png │ │ ├── tutorial_07_final.png │ │ ├── tutorial_08-09_final.png │ │ ├── tutorial_10-11_final.png │ │ └── xhr_service_final.png ├── spec │ ├── domSpec.js │ ├── ngdocSpec.js │ ├── sitemapSpec.js │ ├── specs.js │ └── writerSpec.js └── src │ ├── SiteMap.js │ ├── appCache.js │ ├── dom.js │ ├── example.js │ ├── gen-docs.js │ ├── ignore.words │ ├── ngdoc.js │ ├── reader.js │ ├── templates │ ├── .htaccess │ ├── css │ │ ├── bootstrap.min.css │ │ ├── doc_widgets.css │ │ ├── docs.css │ │ └── font-awesome.css │ ├── docs-scenario.html │ ├── favicon.ico │ ├── font │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.svgz │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── index.html │ ├── js │ │ ├── docs.js │ │ ├── jquery.js │ │ └── jquery.min.js │ └── offline.html │ └── writer.js ├── example ├── buzz │ ├── buzz.css │ ├── buzz.html │ └── buzz.js ├── index.html ├── personalLog │ ├── personalLog.html │ ├── personalLog.js │ ├── scenario │ │ ├── personalLogScenario.js │ │ └── runner.html │ └── test │ │ └── personalLogSpec.js ├── temp.html ├── tweeter │ ├── style.css │ ├── tweeter_addressbook.html │ ├── tweeter_demo.html │ └── tweeterclient.js ├── view1.html └── view2.html ├── gdocs.js ├── gen_docs.sh ├── i18n ├── README.md ├── closure │ ├── currencySymbols.js │ ├── datetimeSymbolsExt.js │ ├── datetimesymbols.js │ ├── numberSymbols.js │ └── pluralRules.js ├── e2e │ ├── i18n-e2e.js │ ├── localeTest_cs.html │ ├── localeTest_de.html │ ├── localeTest_en.html │ ├── localeTest_es.html │ ├── localeTest_sk.html │ ├── localeTest_zh.html │ └── runner.html ├── generate.sh ├── run-tests.sh ├── spec │ ├── closureI18nExtractorSpec.js │ ├── converterSpec.js │ ├── parserSpec.js │ └── utilSpec.js ├── src │ ├── closureI18nExtractor.js │ ├── closureSlurper.js │ ├── converter.js │ ├── parser.js │ └── util.js └── update-closure.sh ├── images ├── css │ ├── arrow_left.gif │ ├── arrow_right.gif │ └── indicator-wait.png ├── docs │ ├── Diagrams.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ ├── image1.png │ │ ├── image2.png │ │ ├── image4.png │ │ ├── image8.png │ │ └── image9.png │ ├── guide │ │ ├── about_controller.graffle │ │ ├── about_model.graffle │ │ ├── about_view.graffle │ │ │ ├── QuickLook │ │ │ │ ├── Preview.pdf │ │ │ │ └── Thumbnail.tiff │ │ │ ├── data.plist │ │ │ └── image3.png │ │ ├── concepts.graffle │ │ │ ├── data.plist │ │ │ ├── image1.png │ │ │ ├── image4.png │ │ │ └── image5.png │ │ ├── di_sequence.graffle │ │ ├── dom_scope.graffle │ │ ├── form_data_flow.graffle │ │ ├── hashbang_vs_regular_url.graffle │ │ └── simple_scope.graffle │ │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ │ ├── data.plist │ │ │ └── image7.png │ └── tutorial │ │ ├── di_sequence.graffle │ │ ├── simple_scope.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image7.png │ │ ├── tutorial_00.graffle │ │ ├── tutorial_02.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image11.png │ │ ├── tutorial_03.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image13.png │ │ ├── tutorial_04.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image15.png │ │ ├── tutorial_07.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image9.png │ │ ├── tutorial_08-09.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image10.png │ │ ├── tutorial_10-11.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image10.png │ │ ├── tutorial_proto.graffle │ │ ├── QuickLook │ │ │ ├── Preview.pdf │ │ │ └── Thumbnail.tiff │ │ ├── data.plist │ │ └── image7.png │ │ └── xhr_service.graffle ├── favicon.ico └── logo │ ├── AngularJS-Shield.exports │ ├── AngularJS-Shield-huge.png │ ├── AngularJS-Shield-large.png │ ├── AngularJS-Shield-medium.png │ ├── AngularJS-Shield-small.png │ ├── AngularJS-Shield.eps │ └── AngularJS-Shield.pdf │ ├── AngularJS-Shield.graffle │ ├── AngularJS.exports │ ├── AngularJS-huge.png │ ├── AngularJS-large.png │ ├── AngularJS-medium.png │ ├── AngularJS-small.png │ ├── AngularJS.eps │ └── AngularJS.pdf │ └── AngularJS.graffle │ ├── data.plist │ ├── image1.png │ └── image2.png ├── init-repo.sh ├── lib ├── closure-compiler │ ├── COPYING │ ├── README │ ├── compiler.jar │ └── version.txt ├── grunt │ ├── plugins.js │ └── utils.js ├── htmlparser │ └── htmlparser.js ├── jquery │ ├── jquery.js │ ├── jquery.min.js │ └── version.txt └── showdown │ ├── index.js │ └── showdown-0.9.js ├── logs └── .gitignore ├── package.json ├── release-commit.sh ├── src ├── Angular.js ├── AngularPublic.js ├── angular-bootstrap.js ├── angular.prefix ├── angular.suffix ├── apis.js ├── auto │ └── injector.js ├── bootstrap │ ├── bootstrap-prettify.js │ ├── bootstrap.js │ ├── css │ │ └── bootstrap.css │ └── google-prettify │ │ ├── prettify.css │ │ └── prettify.js ├── jqLite.js ├── loader.js ├── loader.prefix ├── loader.suffix ├── module.prefix ├── module.suffix ├── ng │ ├── anchorScroll.js │ ├── browser.js │ ├── cacheFactory.js │ ├── compile.js │ ├── controller.js │ ├── directive │ │ ├── a.js │ │ ├── booleanAttrs.js │ │ ├── directives.js │ │ ├── form.js │ │ ├── input.js │ │ ├── ngBind.js │ │ ├── ngClass.js │ │ ├── ngCloak.js │ │ ├── ngController.js │ │ ├── ngCsp.js │ │ ├── ngEventDirs.js │ │ ├── ngInclude.js │ │ ├── ngInit.js │ │ ├── ngNonBindable.js │ │ ├── ngPluralize.js │ │ ├── ngRepeat.js │ │ ├── ngShowHide.js │ │ ├── ngStyle.js │ │ ├── ngSwitch.js │ │ ├── ngTransclude.js │ │ ├── ngView.js │ │ ├── script.js │ │ ├── select.js │ │ └── style.js │ ├── document.js │ ├── exceptionHandler.js │ ├── filter.js │ ├── filter │ │ ├── filter.js │ │ ├── filters.js │ │ ├── limitTo.js │ │ └── orderBy.js │ ├── http.js │ ├── httpBackend.js │ ├── interpolate.js │ ├── locale.js │ ├── location.js │ ├── log.js │ ├── parse.js │ ├── q.js │ ├── rootElement.js │ ├── rootScope.js │ ├── route.js │ ├── routeParams.js │ ├── sniffer.js │ ├── timeout.js │ └── window.js ├── ngCookies │ └── cookies.js ├── ngLocale │ ├── angular-locale_af-na.js │ ├── angular-locale_af-za.js │ ├── angular-locale_af.js │ ├── angular-locale_am-et.js │ ├── angular-locale_am.js │ ├── angular-locale_ar-001.js │ ├── angular-locale_ar-ae.js │ ├── angular-locale_ar-bh.js │ ├── angular-locale_ar-dz.js │ ├── angular-locale_ar-eg.js │ ├── angular-locale_ar-iq.js │ ├── angular-locale_ar-jo.js │ ├── angular-locale_ar-kw.js │ ├── angular-locale_ar-lb.js │ ├── angular-locale_ar-ly.js │ ├── angular-locale_ar-ma.js │ ├── angular-locale_ar-om.js │ ├── angular-locale_ar-qa.js │ ├── angular-locale_ar-sa.js │ ├── angular-locale_ar-sd.js │ ├── angular-locale_ar-sy.js │ ├── angular-locale_ar-tn.js │ ├── angular-locale_ar-ye.js │ ├── angular-locale_ar.js │ ├── angular-locale_bg-bg.js │ ├── angular-locale_bg.js │ ├── angular-locale_bn-bd.js │ ├── angular-locale_bn-in.js │ ├── angular-locale_bn.js │ ├── angular-locale_ca-ad.js │ ├── angular-locale_ca-es.js │ ├── angular-locale_ca.js │ ├── angular-locale_chr.js │ ├── angular-locale_cs-cz.js │ ├── angular-locale_cs.js │ ├── angular-locale_cy.js │ ├── angular-locale_da-dk.js │ ├── angular-locale_da.js │ ├── angular-locale_de-at.js │ ├── angular-locale_de-be.js │ ├── angular-locale_de-ch.js │ ├── angular-locale_de-de.js │ ├── angular-locale_de-li.js │ ├── angular-locale_de-lu.js │ ├── angular-locale_de.js │ ├── angular-locale_el-cy.js │ ├── angular-locale_el-gr.js │ ├── angular-locale_el-polyton.js │ ├── angular-locale_el.js │ ├── angular-locale_en-as.js │ ├── angular-locale_en-au.js │ ├── angular-locale_en-bb.js │ ├── angular-locale_en-be.js │ ├── angular-locale_en-bm.js │ ├── angular-locale_en-bw.js │ ├── angular-locale_en-bz.js │ ├── angular-locale_en-ca.js │ ├── angular-locale_en-dsrt-us.js │ ├── angular-locale_en-dsrt.js │ ├── angular-locale_en-fm.js │ ├── angular-locale_en-gb.js │ ├── angular-locale_en-gu.js │ ├── angular-locale_en-gy.js │ ├── angular-locale_en-hk.js │ ├── angular-locale_en-ie.js │ ├── angular-locale_en-in.js │ ├── angular-locale_en-iso.js │ ├── angular-locale_en-jm.js │ ├── angular-locale_en-mh.js │ ├── angular-locale_en-mp.js │ ├── angular-locale_en-mt.js │ ├── angular-locale_en-mu.js │ ├── angular-locale_en-na.js │ ├── angular-locale_en-nz.js │ ├── angular-locale_en-ph.js │ ├── angular-locale_en-pk.js │ ├── angular-locale_en-pr.js │ ├── angular-locale_en-pw.js │ ├── angular-locale_en-sg.js │ ├── angular-locale_en-tc.js │ ├── angular-locale_en-tt.js │ ├── angular-locale_en-um.js │ ├── angular-locale_en-us.js │ ├── angular-locale_en-vg.js │ ├── angular-locale_en-vi.js │ ├── angular-locale_en-za.js │ ├── angular-locale_en-zw.js │ ├── angular-locale_en-zz.js │ ├── angular-locale_en.js │ ├── angular-locale_es-419.js │ ├── angular-locale_es-ar.js │ ├── angular-locale_es-bo.js │ ├── angular-locale_es-cl.js │ ├── angular-locale_es-co.js │ ├── angular-locale_es-cr.js │ ├── angular-locale_es-do.js │ ├── angular-locale_es-ea.js │ ├── angular-locale_es-ec.js │ ├── angular-locale_es-es.js │ ├── angular-locale_es-gq.js │ ├── angular-locale_es-gt.js │ ├── angular-locale_es-hn.js │ ├── angular-locale_es-ic.js │ ├── angular-locale_es-mx.js │ ├── angular-locale_es-ni.js │ ├── angular-locale_es-pa.js │ ├── angular-locale_es-pe.js │ ├── angular-locale_es-pr.js │ ├── angular-locale_es-py.js │ ├── angular-locale_es-sv.js │ ├── angular-locale_es-us.js │ ├── angular-locale_es-uy.js │ ├── angular-locale_es-ve.js │ ├── angular-locale_es.js │ ├── angular-locale_et-ee.js │ ├── angular-locale_et.js │ ├── angular-locale_eu-es.js │ ├── angular-locale_eu.js │ ├── angular-locale_fa-af.js │ ├── angular-locale_fa-ir.js │ ├── angular-locale_fa.js │ ├── angular-locale_fi-fi.js │ ├── angular-locale_fi.js │ ├── angular-locale_fil-ph.js │ ├── angular-locale_fil.js │ ├── angular-locale_fr-be.js │ ├── angular-locale_fr-bf.js │ ├── angular-locale_fr-bi.js │ ├── angular-locale_fr-bj.js │ ├── angular-locale_fr-bl.js │ ├── angular-locale_fr-ca.js │ ├── angular-locale_fr-cd.js │ ├── angular-locale_fr-cf.js │ ├── angular-locale_fr-cg.js │ ├── angular-locale_fr-ch.js │ ├── angular-locale_fr-ci.js │ ├── angular-locale_fr-cm.js │ ├── angular-locale_fr-dj.js │ ├── angular-locale_fr-fr.js │ ├── angular-locale_fr-ga.js │ ├── angular-locale_fr-gf.js │ ├── angular-locale_fr-gn.js │ ├── angular-locale_fr-gp.js │ ├── angular-locale_fr-gq.js │ ├── angular-locale_fr-km.js │ ├── angular-locale_fr-lu.js │ ├── angular-locale_fr-mc.js │ ├── angular-locale_fr-mf.js │ ├── angular-locale_fr-mg.js │ ├── angular-locale_fr-ml.js │ ├── angular-locale_fr-mq.js │ ├── angular-locale_fr-ne.js │ ├── angular-locale_fr-re.js │ ├── angular-locale_fr-rw.js │ ├── angular-locale_fr-sn.js │ ├── angular-locale_fr-td.js │ ├── angular-locale_fr-tg.js │ ├── angular-locale_fr-yt.js │ ├── angular-locale_fr.js │ ├── angular-locale_gl-es.js │ ├── angular-locale_gl.js │ ├── angular-locale_gsw-ch.js │ ├── angular-locale_gsw.js │ ├── angular-locale_gu-in.js │ ├── angular-locale_gu.js │ ├── angular-locale_haw.js │ ├── angular-locale_he-il.js │ ├── angular-locale_he.js │ ├── angular-locale_hi-in.js │ ├── angular-locale_hi.js │ ├── angular-locale_hr-hr.js │ ├── angular-locale_hr.js │ ├── angular-locale_hu-hu.js │ ├── angular-locale_hu.js │ ├── angular-locale_id-id.js │ ├── angular-locale_id.js │ ├── angular-locale_in.js │ ├── angular-locale_is-is.js │ ├── angular-locale_is.js │ ├── angular-locale_it-ch.js │ ├── angular-locale_it-it.js │ ├── angular-locale_it-sm.js │ ├── angular-locale_it.js │ ├── angular-locale_iw.js │ ├── angular-locale_ja-jp.js │ ├── angular-locale_ja.js │ ├── angular-locale_kn-in.js │ ├── angular-locale_kn.js │ ├── angular-locale_ko-kr.js │ ├── angular-locale_ko.js │ ├── angular-locale_ln-cd.js │ ├── angular-locale_ln-cg.js │ ├── angular-locale_ln.js │ ├── angular-locale_lt-lt.js │ ├── angular-locale_lt.js │ ├── angular-locale_lv-lv.js │ ├── angular-locale_lv.js │ ├── angular-locale_ml-in.js │ ├── angular-locale_ml.js │ ├── angular-locale_mo.js │ ├── angular-locale_mr-in.js │ ├── angular-locale_mr.js │ ├── angular-locale_ms-bn.js │ ├── angular-locale_ms-my.js │ ├── angular-locale_ms.js │ ├── angular-locale_mt-mt.js │ ├── angular-locale_mt.js │ ├── angular-locale_nl-aw.js │ ├── angular-locale_nl-be.js │ ├── angular-locale_nl-cw.js │ ├── angular-locale_nl-nl.js │ ├── angular-locale_nl-sx.js │ ├── angular-locale_nl.js │ ├── angular-locale_no.js │ ├── angular-locale_or-in.js │ ├── angular-locale_or.js │ ├── angular-locale_pl-pl.js │ ├── angular-locale_pl.js │ ├── angular-locale_pt-ao.js │ ├── angular-locale_pt-br.js │ ├── angular-locale_pt-gw.js │ ├── angular-locale_pt-mz.js │ ├── angular-locale_pt-pt.js │ ├── angular-locale_pt-st.js │ ├── angular-locale_pt.js │ ├── angular-locale_ro-md.js │ ├── angular-locale_ro-ro.js │ ├── angular-locale_ro.js │ ├── angular-locale_ru-md.js │ ├── angular-locale_ru-ru.js │ ├── angular-locale_ru-ua.js │ ├── angular-locale_ru.js │ ├── angular-locale_sk-sk.js │ ├── angular-locale_sk.js │ ├── angular-locale_sl-si.js │ ├── angular-locale_sl.js │ ├── angular-locale_sq-al.js │ ├── angular-locale_sq.js │ ├── angular-locale_sr-cyrl-ba.js │ ├── angular-locale_sr-cyrl-me.js │ ├── angular-locale_sr-cyrl-rs.js │ ├── angular-locale_sr-cyrl.js │ ├── angular-locale_sr-latn-ba.js │ ├── angular-locale_sr-latn-me.js │ ├── angular-locale_sr-latn-rs.js │ ├── angular-locale_sr-latn.js │ ├── angular-locale_sr-rs.js │ ├── angular-locale_sr.js │ ├── angular-locale_sv-fi.js │ ├── angular-locale_sv-se.js │ ├── angular-locale_sv.js │ ├── angular-locale_sw-ke.js │ ├── angular-locale_sw-tz.js │ ├── angular-locale_sw.js │ ├── angular-locale_ta-in.js │ ├── angular-locale_ta-lk.js │ ├── angular-locale_ta.js │ ├── angular-locale_te-in.js │ ├── angular-locale_te.js │ ├── angular-locale_th-th.js │ ├── angular-locale_th.js │ ├── angular-locale_tl-ph.js │ ├── angular-locale_tl.js │ ├── angular-locale_tr-tr.js │ ├── angular-locale_tr.js │ ├── angular-locale_uk-ua.js │ ├── angular-locale_uk.js │ ├── angular-locale_ur-in.js │ ├── angular-locale_ur-pk.js │ ├── angular-locale_ur.js │ ├── angular-locale_vi-vn.js │ ├── angular-locale_vi.js │ ├── angular-locale_zh-cn.js │ ├── angular-locale_zh-hans-cn.js │ ├── angular-locale_zh-hans-hk.js │ ├── angular-locale_zh-hans-mo.js │ ├── angular-locale_zh-hans-sg.js │ ├── angular-locale_zh-hans.js │ ├── angular-locale_zh-hant-hk.js │ ├── angular-locale_zh-hant-mo.js │ ├── angular-locale_zh-hant-tw.js │ ├── angular-locale_zh-hant.js │ ├── angular-locale_zh-hk.js │ ├── angular-locale_zh-tw.js │ ├── angular-locale_zh.js │ ├── angular-locale_zu-za.js │ └── angular-locale_zu.js ├── ngMobile │ ├── directive │ │ └── ngClick.js │ └── mobile.js ├── ngMock │ └── angular-mocks.js ├── ngResource │ └── resource.js ├── ngSanitize │ ├── directive │ │ └── ngBindHtml.js │ ├── filter │ │ └── linky.js │ └── sanitize.js ├── ngScenario │ ├── Application.js │ ├── Describe.js │ ├── Future.js │ ├── ObjectModel.js │ ├── Runner.js │ ├── Scenario.js │ ├── SpecRunner.js │ ├── angular-bootstrap.js │ ├── angular.prefix │ ├── angular.suffix │ ├── dsl.js │ ├── matchers.js │ └── output │ │ ├── Html.js │ │ ├── Json.js │ │ ├── Object.js │ │ └── Xml.js └── publishExternalApis.js ├── start-iteration.sh ├── test ├── AngularSpec.js ├── ApiSpecs.js ├── BinderSpec.js ├── auto │ └── injectorSpec.js ├── bootstrap │ ├── bootstrapSpec.js │ └── code.html ├── jQueryPatchSpec.js ├── jqLiteSpec.js ├── jquery_alias.js ├── jquery_remove.js ├── loaderSpec.js ├── matchers.js ├── ng │ ├── anchorScrollSpec.js │ ├── browserSpecs.js │ ├── cacheFactorySpec.js │ ├── compileSpec.js │ ├── controllerSpec.js │ ├── directive │ │ ├── aSpec.js │ │ ├── booleanAttrsSpec.js │ │ ├── formSpec.js │ │ ├── inputSpec.js │ │ ├── ngBindSpec.js │ │ ├── ngClassSpec.js │ │ ├── ngClickSpec.js │ │ ├── ngCloakSpec.js │ │ ├── ngControllerSpec.js │ │ ├── ngCspSpec.js │ │ ├── ngEventDirsSpec.js │ │ ├── ngIncludeSpec.js │ │ ├── ngInitSpec.js │ │ ├── ngKeySpec.js │ │ ├── ngNonBindableSpec.js │ │ ├── ngPluralizeSpec.js │ │ ├── ngRepeatSpec.js │ │ ├── ngShowHideSpec.js │ │ ├── ngSrcSpec.js │ │ ├── ngStyleSpec.js │ │ ├── ngSwitchSpec.js │ │ ├── ngViewSpec.js │ │ ├── scriptSpec.js │ │ ├── selectSpec.js │ │ └── styleSpec.js │ ├── documentSpec.js │ ├── exceptionHandlerSpec.js │ ├── filter │ │ ├── filterSpec.js │ │ ├── filtersSpec.js │ │ ├── limitToSpec.js │ │ └── orderBySpec.js │ ├── httpBackendSpec.js │ ├── httpSpec.js │ ├── interpolateSpec.js │ ├── localeSpec.js │ ├── locationSpec.js │ ├── logSpec.js │ ├── parseSpec.js │ ├── qSpec.js │ ├── rootElementSpec.js │ ├── rootScopeSpec.js │ ├── routeParamsSpec.js │ ├── routeSpec.js │ ├── snifferSpec.js │ ├── timeoutSpec.js │ └── windowSpec.js ├── ngCookies │ └── cookiesSpec.js ├── ngMobile │ └── directive │ │ └── ngClickSpec.js ├── ngMock │ └── angular-mocksSpec.js ├── ngResource │ └── resourceSpec.js ├── ngSanitize │ ├── directive │ │ └── ngBindHtmlSpec.js │ ├── filter │ │ └── linkySpec.js │ └── sanitizeSpec.js ├── ngScenario │ ├── ApplicationSpec.js │ ├── DescribeSpec.js │ ├── FutureSpec.js │ ├── ObjectModelSpec.js │ ├── RunnerSpec.js │ ├── ScenarioSpec.js │ ├── SpecRunnerSpec.js │ ├── dslSpec.js │ ├── e2e │ │ ├── Runner-compiled.html │ │ ├── Runner.html │ │ ├── style.css │ │ ├── widgets-scenario.js │ │ └── widgets.html │ ├── jstd-scenario-adapter │ │ └── AdapterSpecs.js │ ├── matchersSpec.js │ ├── mocks.js │ └── output │ │ ├── HtmlSpec.js │ │ ├── jsonSpec.js │ │ ├── objectSpec.js │ │ └── xmlSpec.js └── testabilityPatch.js ├── testacular-e2e.conf.js ├── testacular-jqlite.conf.js ├── testacular-jquery.conf.js ├── testacular-modules.conf.js ├── validate-commit-msg.js ├── validate-commit-msg.spec.js ├── version.js ├── version.yaml └── watchr-docs.rb /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | angularjs.netrc 3 | jstd.log 4 | .DS_Store 5 | gen_docs.disable 6 | test.disable 7 | regression/temp*.html 8 | performance/temp*.html 9 | .idea/workspace.xml 10 | *~ 11 | angular.js.tmproj 12 | node_modules 13 | angular.xcodeproj 14 | .idea 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | 5 | before_script: 6 | - export DISPLAY=:99.0 7 | - sh -e /etc/init.d/xvfb start 8 | - npm install -g grunt-cli 9 | - grunt package 10 | - grunt webserver > /dev/null & 11 | 12 | script: 13 | - grunt test --browsers Firefox --reporters=dots 14 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Submitting issues 2 | 3 | If you have questions about how to use AngularJS, please direct these to the 4 | [Google Group][groups] discussion list or [StackOverflow][stackoverflow]. We are 5 | also available on [IRC][irc]. 6 | 7 | ### Guidelines 8 | 9 | * Search the archive first, it's likely that your question was already answered. 10 | * A live example demonstrating your problem or question, will get an answer faster. 11 | * Create one using this [template][template] 12 | * If you get help, help others. Good karma rulez! 13 | 14 | If your issue appears to be a bug, and hasn't been reported, open a new issue. 15 | Help us to maximize the effort we can spend fixing issues and adding new 16 | features, by not reporting duplicate issues. 17 | 18 | [stackoverflow]: http://stackoverflow.com/questions/tagged/angularjs 19 | [groups]: https://groups.google.com/forum/?fromgroups#!forum/angular 20 | [irc]: http://webchat.freenode.net/?channels=angularjs&uio=d4 21 | [template]: http://plnkr.co/edit/gist:3510140 22 | 23 | ## Contributing to Source Code 24 | 25 | We'd love for you to contribute to our source code and to make AngularJS even 26 | better than it is today! 27 | 28 | Please read the [contribution guidelines][contribute] to learn about how to submit code as well as 29 | other useful info like how to build and test AngularJS code. 30 | 31 | [list]: https://groups.google.com/forum/?fromgroups#!forum/angular 32 | [contribute]: http://docs.angularjs.org/misc/contribute 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2012 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AngularJS 2 | ========= 3 | 4 | AngularJS lets you write client-side web applications as if you had a smarter browser. It lets you 5 | use good old HTML (or HAML, Jade and friends!) as your template language and lets you extend HTML’s 6 | syntax to express your application’s components clearly and succinctly. It automatically 7 | synchronizes data from your UI (view) with your JavaScript objects (model) through 2-way data 8 | binding. To help you structure your application better and make it easy to test, AngularJS teaches 9 | the browser how to do dependency injection and inversion of control. Oh yeah and it also helps with 10 | server-side communication, taming async callbacks with promises and deferreds; and make client-side 11 | navigation and deeplinking with hashbang urls or HTML5 pushState a piece of cake. The best of all: 12 | it makes development fun! 13 | 14 | * Web site: http://angularjs.org 15 | * Tutorial: http://docs.angularjs.org/tutorial 16 | * API Docs: http://docs.angularjs.org/api 17 | * Developer Guide: http://docs.angularjs.org/guide 18 | * Contribution guidelines: http://docs.angularjs.org/misc/contribute 19 | 20 | Building AngularJS 21 | --------- 22 | [Once you have your environment setup](http://docs.angularjs.org/misc/contribute) just run: 23 | 24 | grunt package 25 | 26 | 27 | Running Tests 28 | ------------- 29 | To execute all unit tests, use: 30 | 31 | grunt test:unit 32 | 33 | To execute end-to-end (e2e) tests, use: 34 | 35 | grunt package 36 | grunt test:e2e 37 | 38 | To learn more about the grunt tasks, run `grunt --help` and also read our 39 | [contribution guidelines](http://docs.angularjs.org/misc/contribute). 40 | -------------------------------------------------------------------------------- /changelog.spec.js: -------------------------------------------------------------------------------- 1 | describe('changelog.js', function() { 2 | var ch = require('./changelog'); 3 | 4 | describe('parseRawCommit', function() { 5 | it('should parse raw commit', function() { 6 | var msg = ch.parseRawCommit( 7 | '9b1aff905b638aa274a5fc8f88662df446d374bd\n' + 8 | 'feat(scope): broadcast $destroy event on scope destruction\n' + 9 | 'perf testing shows that in chrome this change adds 5-15% overhead\n' + 10 | 'when destroying 10k nested scopes where each scope has a $destroy listener\n'); 11 | 12 | expect(msg.type).toBe('feat'); 13 | expect(msg.hash).toBe('9b1aff905b638aa274a5fc8f88662df446d374bd'); 14 | expect(msg.subject).toBe('broadcast $destroy event on scope destruction'); 15 | expect(msg.body).toBe('perf testing shows that in chrome this change adds 5-15% overhead\n' + 16 | 'when destroying 10k nested scopes where each scope has a $destroy listener\n') 17 | expect(msg.component).toBe('scope'); 18 | }); 19 | 20 | 21 | it('should parse closed issues', function() { 22 | var msg = ch.parseRawCommit( 23 | '13f31602f396bc269076ab4d389cfd8ca94b20ba\n' + 24 | 'feat(ng-list): Allow custom separator\n' + 25 | 'bla bla bla\n\n' + 26 | 'Closes #123\nCloses #25\n'); 27 | 28 | expect(msg.closes).toEqual([123, 25]); 29 | }); 30 | 31 | 32 | it('should parse breaking changes', function() { 33 | var msg = ch.parseRawCommit( 34 | '13f31602f396bc269076ab4d389cfd8ca94b20ba\n' + 35 | 'feat(ng-list): Allow custom separator\n' + 36 | 'bla bla bla\n\n' + 37 | 'BREAKING CHANGE: first breaking change\nsomething else\n' + 38 | 'another line with more info\n'); 39 | 40 | expect(msg.breaking).toEqual(' first breaking change\nsomething else\nanother line with more info\n'); 41 | }); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | display: none; 6 | } 7 | 8 | ng\:form { 9 | display: block; 10 | } 11 | -------------------------------------------------------------------------------- /docs/content/api/index.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name API Reference 3 | @description 4 | 5 | Use the API Reference documentation when you need more information about a specific feature. Check out 6 | {@link guide/ Developer Guide} for AngularJS concepts. If you are new to AngularJS we recommend the 7 | {@link tutorial/ Tutorial}. 8 | -------------------------------------------------------------------------------- /docs/content/api/ng.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name ng 3 | @description 4 | 5 | The `ng` is an angular module which contains all of the core angular services. 6 | -------------------------------------------------------------------------------- /docs/content/cookbook/helloworld.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Cookbook: Hello World 3 | @description 4 | 5 | 6 | 7 | 12 |
13 | Your name: 14 |
15 | Hello {{name}}! 16 |
17 |
18 | 19 | it('should change the binding when user enters text', function() { 20 | expect(binding('name')).toEqual('World'); 21 | input('name').enter('angular'); 22 | expect(binding('name')).toEqual('angular'); 23 | }); 24 | 25 |
26 | 27 | # Things to notice 28 | 29 | Take a look through the source and note: 30 | 31 | * The script tag that {@link guide/bootstrap bootstraps} the Angular environment. 32 | * The text {@link api/ng.directive:input input form control} which is 33 | bound to the greeting name text. 34 | * There is no need for listener registration and event firing on change events. 35 | * The implicit presence of the `name` variable which is in the root {@link api/ng.$rootScope.Scope scope}. 36 | * The double curly brace `{{markup}}`, which binds the name variable to the greeting text. 37 | * The concept of {@link guide/dev_guide.templates.databinding data binding}, which reflects any 38 | changes to the 39 | input field in the greeting text. 40 | -------------------------------------------------------------------------------- /docs/content/cookbook/index.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Cookbook 3 | @description 4 | 5 | Welcome to the Angular cookbook. Here we will show you typical uses of Angular by example. 6 | 7 | 8 | # Hello World 9 | 10 | {@link helloworld Hello World}: The simplest possible application that demonstrates the 11 | classic Hello World! 12 | 13 | 14 | # Basic Form 15 | 16 | {@link form Basic Form}: Displaying forms to the user for editing is the bread and butter 17 | of web applications. Angular makes forms easy through bidirectional data binding. 18 | 19 | 20 | # Advanced Form 21 | 22 | {@link advancedform Advanced Form}: Taking the form example to the next level and 23 | providing advanced features such as dirty detection, form reverting and submit disabling if 24 | validation errors exist. 25 | 26 | 27 | # Model View Controller 28 | 29 | {@link mvc MVC}: Tic-Tac-Toe: Model View Controller (MVC) is a time-tested design pattern 30 | to separate the behavior (JavaScript controller) from the presentation (HTML view). This 31 | separation aids in maintainability and testability of your project. 32 | 33 | 34 | # Multi-page App and Deep Linking 35 | 36 | {@link deeplinking Deep Linking}: An AJAX application never navigates away from the 37 | first page it loads. Instead, it changes the DOM of its single page. Eliminating full-page reloads 38 | is what makes AJAX apps responsive, but it creates a problem in that apps with a single URL 39 | prevent you from emailing links to a particular screen within your application. 40 | 41 | Deep linking tries to solve this by changing the URL anchor without reloading a page, thus 42 | allowing you to send links to specific screens in your app. 43 | 44 | 45 | # Services 46 | 47 | {@link api/ng Services}: Services are long lived objects in your applications that are 48 | available across controllers. A collection of useful services are pre-bundled with Angular but you 49 | will likely add your own. Services are initialized using dependency injection, which resolves the 50 | order of initialization. This safeguards you from the perils of global state (a common way to 51 | implement long lived objects). 52 | 53 | 54 | # External Resources 55 | 56 | {@link buzz Resources}: Web applications must be able to communicate with the external 57 | services to get and update data. Resources are the abstractions of external URLs which are 58 | specially tailored to Angular data binding. 59 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.mvc.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: About MVC in Angular 3 | @description 4 | 5 | While Model-View-Controller (MVC) has acquired different shades of meaning over the years since it 6 | first appeared, Angular incorporates the basic principles behind the original {@link 7 | http://en.wikipedia.org/wiki/Model–view–controller MVC} software design pattern into its way of 8 | building client-side web applications. 9 | 10 | The MVC pattern summarized: 11 | 12 | * Separate applications into distinct presentation, data, and logic components 13 | * Encourage loose coupling between these components 14 | 15 | Along with {@link dev_guide.services services} and {@link di dependency injection}, MVC 16 | makes angular applications better structured, easier to maintain and more testable. 17 | 18 | The following topics explain how angular incorporates the MVC pattern into the angular way of 19 | developing web applications: 20 | 21 | * {@link dev_guide.mvc.understanding_model Understanding the Model Component} 22 | * {@link dev_guide.mvc.understanding_controller Understanding the Controller Component} 23 | * {@link dev_guide.mvc.understanding_view Understanding the View Component} 24 | 25 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.mvc.understanding_view.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: About MVC in Angular: Understanding the View Component 3 | @description 4 | 5 | In Angular, the view is the DOM loaded and rendered in the browser, after Angular has transformed 6 | the DOM based on information in the template, controller and model. 7 | 8 | 9 | 10 | In the Angular implementation of MVC, the view has knowledge of both the model and the controller. 11 | The view knows about the model where two-way data-binding occurs. The view has knowledge of the 12 | controller through Angular directives, such as {@link api/ng.directive:ngController 13 | ngController} and {@link api/ng.directive:ngView ngView}, and through bindings of this form: 14 | `{{someControllerFunction()}}`. In these ways, the view can call functions in an associated 15 | controller function. 16 | 17 | 18 | ## Related Topics 19 | 20 | * {@link dev_guide.mvc About MVC in Angular} 21 | * {@link dev_guide.mvc.understanding_model Understanding the Model Component} 22 | * {@link dev_guide.mvc.understanding_controller Understanding the Controller Component} 23 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.services.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Angular Services 3 | @description 4 | 5 | Services are a feature that Angular brings to client-side web apps from the server side, where 6 | services have been commonly used for a long time. Services in Angular apps are substitutable 7 | objects that are wired together using {@link di dependency injection (DI)}. 8 | 9 | 10 | ## Related Topics 11 | 12 | * {@link dev_guide.services.understanding_services Understanding Angular Services} 13 | * {@link dev_guide.services.creating_services Creating Angular Services} 14 | * {@link dev_guide.services.managing_dependencies Managing Service Dependencies} 15 | * {@link dev_guide.services.injecting_controllers Injecting Services Into Controllers} 16 | * {@link dev_guide.services.testing_services Testing Angular Services} 17 | 18 | ## Related API 19 | 20 | * {@link api/ng Angular Service API} 21 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.services.testing_services.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Angular Services: Testing Angular Services 3 | @description 4 | 5 | The following is a unit test for the 'notify' service in the 'Dependencies' example in {@link 6 | dev_guide.services.creating_services Creating Angular Services}. The unit test example uses Jasmine 7 | spy (mock) instead of a real browser alert. 8 | 9 |
10 | var mock, notify;
11 | 
12 | beforeEach(function() {
13 |   mock = {alert: jasmine.createSpy()};
14 | 
15 |   module(function($provide) {
16 |     $provide.value('$window', mock);
17 |   });
18 | 
19 |   inject(function($injector) {
20 |     notify = $injector.get('notify');
21 |   });
22 | });
23 | 
24 | it('should not alert first two notifications', function() {
25 |   notify('one');
26 |   notify('two');
27 | 
28 |   expect(mock.alert).not.toHaveBeenCalled();
29 | });
30 | 
31 | it('should alert all after third notification', function() {
32 |   notify('one');
33 |   notify('two');
34 |   notify('three');
35 | 
36 |   expect(mock.alert).toHaveBeenCalledWith("one\ntwo\nthree");
37 | });
38 | 
39 | it('should clear messages after alert', function() {
40 |   notify('one');
41 |   notify('two');
42 |   notify('third');
43 |   notify('more');
44 |   notify('two');
45 |   notify('third');
46 | 
47 |   expect(mock.alert.callCount).toEqual(2);
48 |   expect(mock.alert.mostRecentCall.args).toEqual(["more\ntwo\nthird"]);
49 | });
50 | 
51 | 52 | 53 | ## Related Topics 54 | 55 | * {@link dev_guide.services.understanding_services Understanding Angular Services} 56 | * {@link dev_guide.services.creating_services Creating Angular Services} 57 | * {@link dev_guide.services.managing_dependencies Managing Service Dependencies} 58 | * {@link dev_guide.services.injecting_controllers Injecting Services Into Controllers} 59 | 60 | ## Related API 61 | 62 | * {@link api/ng Angular Service API} 63 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.services.understanding_services.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Angular Services: Understanding Angular Services 3 | @description 4 | 5 | Angular services are singletons that carry out specific tasks common to web apps, such as the 6 | {@link api/ng.$http $http service} that provides low level access to the browser's 7 | `XMLHttpRequest` object. 8 | 9 | To use an Angular service, you identify it as a dependency for the dependent (a controller, or 10 | another service) that depends on the service. Angular's dependency injection subsystem takes care 11 | of the rest. The Angular injector subsystem is in charge of service instantiation, resolution of 12 | dependencies, and provision of dependencies to factory functions as requested. 13 | 14 | Angular injects dependencies using "constructor" injection (the service is passed in via a factory 15 | function). Because JavaScript is a dynamically typed language, Angular's dependency injection 16 | subsystem cannot use static types to identify service dependencies. For this reason a dependent 17 | must explicitly define its dependencies by using the `$inject` property. For example: 18 | 19 | myController.$inject = ['$location']; 20 | 21 | The Angular web framework provides a set of services for common operations. Like other core Angular 22 | variables and identifiers, the built-in services always start with `$` (such as `$http` mentioned 23 | above). You can also create your own custom services. 24 | 25 | 26 | ## Related Topics 27 | 28 | * {@link di About Angular Dependency Injection} 29 | * {@link dev_guide.services.creating_services Creating Angular Services} 30 | * {@link dev_guide.services.managing_dependencies Managing Service Dependencies} 31 | * {@link dev_guide.services.testing_services Testing Angular Services} 32 | 33 | ## Related API 34 | 35 | * {@link api/ng Angular Service API} 36 | * {@link api/angular.injector Injector API} 37 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.templates.css-styling.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Templates: Working With CSS in Angular 3 | @description 4 | 5 | 6 | Angular sets these CSS classes. It is up to your application to provide useful styling. 7 | 8 | # CSS classes used by angular 9 | 10 | * `ng-invalid`, `ng-valid` 11 | - **Usage:** angular applies this class to an input widget element if that element's input does 12 | not pass validation. (see {@link api/ng.directive:input input} directive). 13 | 14 | * `ng-pristine`, `ng-dirty` 15 | - **Usage:** angular {@link api/ng.directive:input input} directive applies `ng-pristine` class 16 | to a new input widget element which did not have user interaction. Once the user interacts with 17 | the input widget the class is changed to `ng-dirty`. 18 | 19 | 20 | ## Related Topics 21 | 22 | * {@link dev_guide.templates Angular Templates} 23 | * {@link forms Angular Forms} 24 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.templates.databinding.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Templates: Data Binding in Angular 3 | @description 4 | 5 | Data-binding in Angular web apps is the automatic syncronization of data between the model and view 6 | components. The way that Angular implements data-binding lets you treat the model as the 7 | single-source-of-truth in your application. The view is a projection of the model at all times. 8 | When the model changes, the view reflects the change, and vice versa. 9 | 10 | ## Data Binding in Classical Template Systems 11 | 12 | 13 | Most templating systems bind data in only one direction: they merge template and model components 14 | together into a view, as illustrated in the diagram. After the merge occurs, changes to the model 15 | or related sections of the view are NOT automatically reflected in the view. Worse, any changes 16 | that the user makes to the view are not reflected in the model. This means that the developer has 17 | to write code that constantly syncs the view with the model and the model with the view. 18 | 19 | ## Data Binding in Angular Templates 20 | 21 | 22 | The way Angular templates works is different, as illustrated in the diagram. They are different 23 | because first the template (which is the uncompiled HTML along with any additional markup or 24 | directives) is compiled on the browser, and second, the compilation step produces a live view. We 25 | say live because any changes to the view are immediately reflected in the model, and any changes in 26 | the model are propagated to the view. This makes the model always the single-source-of-truth for 27 | the application state, greatly simplifying the programming model for the developer. You can think of 28 | the view as simply an instant projection of your model. 29 | 30 | Because the view is just a projection of the model, the controller is completely separated from the 31 | view and unaware of it. This makes testing a snap because it is easy to test your controller in 32 | isolation without the view and the related DOM/browser dependency. 33 | 34 | 35 | ## Related Topics 36 | 37 | * {@link scope Angular Scopes} 38 | * {@link dev_guide.templates Angular Templates} 39 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Templates: Filters: Creating Angular Filters 3 | @description 4 | 5 | Writing your own filter is very easy: just register a new filter (injectable) factory function with 6 | your module. This factory function should return a new filter function which takes the input value 7 | as the first argument. Any filter arguments are passed in as additional arguments to the filter 8 | function. 9 | 10 | The following sample filter reverses a text string. In addition, it conditionally makes the 11 | text upper-case and assigns color. 12 | 13 | 14 | 15 | 35 | 36 |
37 |
38 | No filter: {{greeting}}
39 | Reverse: {{greeting|reverse}}
40 | Reverse + uppercase: {{greeting|reverse:true}}
41 |
42 |
43 | 44 | it('should reverse greeting', function() { 45 | expect(binding('greeting|reverse')).toEqual('olleh'); 46 | input('greeting').enter('ABC'); 47 | expect(binding('greeting|reverse')).toEqual('CBA'); 48 | }); 49 | 50 |
51 | 52 | 53 | ## Related Topics 54 | 55 | * {@link dev_guide.templates.filters Understanding Angular Filters} 56 | * {@link compiler Angular HTML Compiler} 57 | 58 | ## Related API 59 | 60 | * {@link api/ng.$filter Angular Filter API} 61 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.templates.filters.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Templates: Understanding Angular Filters 3 | @description 4 | 5 | Angular filters format data for display to the user. 6 | 7 | For example, you might have a data object that needs to be formatted according to the locale before 8 | displaying it to the user. You can pass expressions through a chain of filters like this: 9 | 10 | name | uppercase 11 | 12 | The expression evaluator simply passes the value of name to 13 | {@link api/ng.filter:uppercase uppercase filter}. 14 | 15 | 16 | ## Related Topics 17 | 18 | * {@link dev_guide.templates.filters.using_filters Using Angular Filters} 19 | * {@link dev_guide.templates.filters.creating_filters Creating Angular Filters} 20 | 21 | ## Related API 22 | 23 | * {@link api/ng.$filter Angular Filter API} 24 | -------------------------------------------------------------------------------- /docs/content/guide/dev_guide.templates.filters.using_filters.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Templates: Filters: Using Angular Filters 3 | @description 4 | 5 | Filters can be part of any {@link api/ng.$rootScope.Scope} evaluation but are typically used to format 6 | expressions in bindings in your templates: 7 | 8 | {{ expression | filter }} 9 | 10 | Filters typically transform the data to a new data type, formatting the data in the process. 11 | Filters can also be chained, and can take optional arguments. 12 | 13 | You can chain filters using this syntax: 14 | 15 | {{ expression | filter1 | filter2 }} 16 | 17 | You can also pass colon-delimited arguments to filters, for example, to display the number 123 with 18 | 2 decimal points: 19 | 20 | 123 | number:2 21 | 22 | Here are some examples that show values before and after applying different filters to an 23 | expression in a binding: 24 | 25 | * No filter: `{{1234.5678}}` => `1234.5678` 26 | * Number filter: `{{1234.5678|number}}` => `1,234.57`. Notice the "," and rounding to two 27 | significant digits. 28 | * Filter with arguments: `{{1234.5678|number:5}}` => `1,234.56780`. Filters can take optional 29 | arguments, separated by colons in a binding. For example, the "number" filter takes a number 30 | argument that specifies how many digits to display to the right of the decimal point. 31 | 32 | 33 | ## Related Topics 34 | 35 | * {@link dev_guide.templates.filters Understanding Angular Filters} 36 | * {@link dev_guide.templates.filters.creating_filters Creating Angular Filters} 37 | 38 | ## Related API 39 | 40 | * {@link api/ng.$filter Angular Filter API} 41 | -------------------------------------------------------------------------------- /docs/content/guide/index.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide 3 | @description 4 | 5 | Welcome to the angular Developer Guide. If you are here to learn the details of how to use angular 6 | to develop web apps, you've come to the right place. 7 | 8 | If you are completely or relatively unfamiliar with angular, you may want to check out one or both 9 | of the following documents before returning here to the Developer Guide: 10 | 11 | * {@link misc/started Getting Started} 12 | * {@link tutorial/index Angular Tutorial} 13 | -------------------------------------------------------------------------------- /docs/content/guide/introduction.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Introduction 3 | @description 4 | 5 | Angular is pure client-side technology, written entirely in JavaScript. It works with the 6 | long-established technologies of the web (HTML, CSS, and JavaScript) to make the development of 7 | web apps easier and faster than ever before. 8 | 9 | One important way that Angular simplifies web development is by increasing the level of abstraction 10 | between the developer and most low-level web app development tasks. Angular automatically takes 11 | care of many of these tasks, including: 12 | 13 | * DOM Manipulation 14 | * Setting Up Listeners and Notifiers 15 | * Input Validation 16 | 17 | Because Angular handles much of the work involved in these tasks, developers can concentrate more 18 | on application logic and less on repetitive, error-prone, lower-level coding. 19 | 20 | At the same time that Angular simplifies the development of web apps, it brings relatively 21 | sophisticated techniques to the client-side, including: 22 | 23 | * Separation of data, application logic, and presentation components 24 | * Data Binding between data and presentation components 25 | * Services (common web app operations, implemented as substitutable objects) 26 | * Dependency Injection (used primarily for wiring together services) 27 | * An extensible HTML compiler (written entirely in JavaScript) 28 | * Ease of Testing 29 | 30 | These techniques have been for the most part absent from the client-side for far too long. 31 | 32 | ## Single-page / Round-trip Applications 33 | 34 | You can use Angular to develop both single-page and round-trip apps, but Angular is designed 35 | primarily for developing single-page apps. Angular supports browser history, forward and back 36 | buttons, and bookmarking in single-page apps. 37 | 38 | You normally wouldn't want to load Angular with every page change, as would be the case with using 39 | Angular in a round-trip app. However, it would make sense to do so if you were adding a subset of 40 | Angular's features (for example, templates to leverage angular's data-binding feature) to an 41 | existing round-trip app. You might follow this course of action if you were migrating an older app 42 | to a single-page Angular app. 43 | -------------------------------------------------------------------------------- /docs/content/guide/type.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Developer Guide: Type 3 | @description 4 | -------------------------------------------------------------------------------- /docs/content/misc/started.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Getting Started 3 | @description 4 | 5 | We want you to have an easy time while starting to use Angular. We've put together the following steps on your path to 6 | becoming an Angular expert. 7 | 8 | 1. Read the {@link guide/concepts conceptual overview}.
Understand Angular's vocabulary and how all the Angular 9 | components work together. 10 | 1. Do the {@link tutorial/ AngularJS Tutorial}.
Walk end-to-end through building and application complete with tests 11 | on top of a node.js web server. Covers every major AngularJS feature and show you how to set up your development 12 | environment. 13 | 1. Download or clone the {@link https://github.com/angular/angular-seed Seed App project template}.
Gives you a 14 | starter app with a directory layout, test harness, and scripts to begin building your application. 15 | 16 | 17 | #Further Steps 18 | 19 | ##Watch Videos 20 | 21 | If you haven’t had a chance to watch the videos from the homepage, please check out: 22 | * {@link http://www.youtube.com/watch?v=WuiHuZq_cg4&list=PL173F1A311439C05D&context=C48ac877ADvjVQa1PpcFONnl4Q5x8hqvT6tRBTE-m0-Ym47jO3PEE%3D Introduction to AngularJS} 23 | * {@link http://www.youtube.com/watch?v=Yg-R1gchccg&list=PL173F1A311439C05D&context=C48ac877ADvjVQa1PpcFONnl4Q5x8hqvT6tRBTE-m0-Ym47jO3PEE%3D Creating Directives} 24 | * {@link http://www.youtube.com/watch?v=IRelx4-ISbs&list=PL173F1A311439C05D&context=C48ac877ADvjVQa1PpcFONnl4Q5x8hqvT6tRBTE-m0-Ym47jO3PEE%3D Communicating with Servers} 25 | 26 | And visit our {@link http://www.youtube.com/user/angularjs YouTube channel} for more AngularJS video presentations and 27 | tutorials. 28 | 29 | ##Subscribe 30 | 31 | * Subscribe to the {@link http://groups.google.com/forum/?fromgroups#!forum/angular mailing list}. Ask questions here! 32 | * Follow us on {@link https://twitter.com/intent/follow?original_referer=http%3A%2F%2Fangularjs.org%2F®ion=follow_link&screen_name=angularjs&source=followbutton&variant=2.0 Twitter} 33 | * Add us to your circles on {@link https://plus.google.com/110323587230527980117/posts Google+} 34 | 35 | ##Read more 36 | 37 | The AngularJS documentation includes the {@link guide/index Developer Guide} covering concepts and the 38 | {@link api/ API Reference} for syntax and usage. 39 | -------------------------------------------------------------------------------- /docs/content/tutorial/step_01.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Tutorial: 1 - Static Template 3 | @description 4 | 5 | 6 | 7 | 8 | In order to illustrate how Angular enhances standard HTML, you will create a purely *static* HTML 9 | page and then examine how we can turn this HTML code into a template that Angular will use to 10 | dynamically display the same result with any set of data. 11 | 12 | In this step you will add some basic information about two cell phones to an HTML page. 13 | 14 | 15 |
16 | 17 | 18 | The page now contains a list with information about two phones. 19 | 20 | The most important changes are listed below. You can see the full diff on {@link 21 | https://github.com/angular/angular-phonecat/compare/step-0...step-1 GitHub}: 22 | 23 | __`app/index.html`:__ 24 |
25 |   
39 | 
40 | 41 | 42 | # Experiments 43 | 44 | * Try adding more static HTML to `index.html`. For example: 45 | 46 |

Total number of phones: 2

47 | 48 | 49 | # Summary 50 | 51 | This addition to your app uses static HTML to display the list. Now, let's go to {@link step_02 52 | step 2} to learn how to use AngularJS to dynamically generate the same list. 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/content/tutorial/the_end.ngdoc: -------------------------------------------------------------------------------- 1 | @ngdoc overview 2 | @name Tutorial: The End 3 | @description 4 | 5 | Our application is now complete. Feel free to experiment with the code further, and jump back to 6 | previous steps using the `git checkout` command. 7 | 8 | For more details and examples of the Angular concepts we touched on in this tutorial, see the 9 | {@link guide/ Developer Guide}. 10 | 11 | For several more examples of code, see the {@link cookbook/ Cookbook}. 12 | 13 | When you are ready to start developing a project using Angular, we recommend that you bootstrap 14 | your development with the {@link https://github.com/angular/angular-seed angular-seed} project. 15 | 16 | We hope this tutorial was useful to you and that you learned enough about Angular to make you want 17 | to learn more. We especially hope you are inspired to go out and develop Angular web apps of your 18 | own, and that you might be interested in {@link misc/contribute contributing} to Angular. 19 | 20 | If you have questions or feedback or just want to say "hi", please post a message at {@link 21 | https://groups.google.com/forum/#!forum/angular}. 22 | -------------------------------------------------------------------------------- /docs/img/AngularJS-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/AngularJS-small.png -------------------------------------------------------------------------------- /docs/img/One_Way_Data_Binding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/One_Way_Data_Binding.png -------------------------------------------------------------------------------- /docs/img/Two_Way_Data_Binding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/Two_Way_Data_Binding.png -------------------------------------------------------------------------------- /docs/img/angular_parts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/angular_parts.png -------------------------------------------------------------------------------- /docs/img/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/bullet.png -------------------------------------------------------------------------------- /docs/img/form_data_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/form_data_flow.png -------------------------------------------------------------------------------- /docs/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /docs/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /docs/img/guide/about_model_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/about_model_final.png -------------------------------------------------------------------------------- /docs/img/guide/about_view_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/about_view_final.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-controller.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-directive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-directive.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-model.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-module-injector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-module-injector.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-runtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-runtime.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-scope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-scope.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-startup.png -------------------------------------------------------------------------------- /docs/img/guide/concepts-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/concepts-view.png -------------------------------------------------------------------------------- /docs/img/guide/di_sequence_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/di_sequence_final.png -------------------------------------------------------------------------------- /docs/img/guide/dom_scope_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/dom_scope_final.png -------------------------------------------------------------------------------- /docs/img/guide/hashbang_vs_regular_url.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/hashbang_vs_regular_url.jpg -------------------------------------------------------------------------------- /docs/img/guide/scenario_runner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/scenario_runner.png -------------------------------------------------------------------------------- /docs/img/guide/simple_scope_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/guide/simple_scope_final.png -------------------------------------------------------------------------------- /docs/img/helloworld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/helloworld.png -------------------------------------------------------------------------------- /docs/img/helloworld_2way.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/helloworld_2way.png -------------------------------------------------------------------------------- /docs/img/tutorial/catalog_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/catalog_screen.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_00.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_00_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_00_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_02.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_03.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_04.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_07_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_07_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_08-09_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_08-09_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/tutorial_10-11_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/tutorial_10-11_final.png -------------------------------------------------------------------------------- /docs/img/tutorial/xhr_service_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/img/tutorial/xhr_service_final.png -------------------------------------------------------------------------------- /docs/spec/domSpec.js: -------------------------------------------------------------------------------- 1 | var DOM = require('../src/dom.js').DOM; 2 | 3 | describe('dom', function() { 4 | var dom; 5 | 6 | beforeEach(function() { 7 | dom = new DOM(); 8 | }); 9 | 10 | describe('h', function() { 11 | 12 | it('should render using function', function() { 13 | var cbThis; 14 | var cdValue; 15 | dom.h('heading', 'content', function(value){ 16 | cbThis = this; 17 | cbValue = value; 18 | }); 19 | expect(cbThis).toEqual(dom); 20 | expect(cbValue).toEqual('content'); 21 | }); 22 | 23 | it('should update heading numbers', function() { 24 | dom.h('heading', function() { 25 | this.html('

sub-heading

'); 26 | }); 27 | expect(dom.toString()).toContain('

heading

'); 28 | expect(dom.toString()).toContain('

sub-heading

'); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /docs/spec/sitemapSpec.js: -------------------------------------------------------------------------------- 1 | var SiteMap = require('../src/SiteMap.js').SiteMap; 2 | var Doc = require('../src/ngdoc.js').Doc; 3 | 4 | 5 | describe('sitemap', function() { 6 | it('should render empty sitemap', function() { 7 | var map = new SiteMap([]); 8 | expect(map.render()).toEqual([ 9 | '', 10 | '', 11 | '', ''].join('\n')); 12 | }); 13 | 14 | it('should render ngdoc url', function() { 15 | var map = new SiteMap([new Doc({section: 'foo', id: 'a.b.c<>\'"&'})]); 16 | expect(map.render()).toContain([ 17 | ' ', 18 | 'http://docs.angularjs.org/foo/a.b.c<>'"&', 19 | 'weekly', 20 | ''].join('')); 21 | 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /docs/spec/specs.js: -------------------------------------------------------------------------------- 1 | if (global.jasmine) return; 2 | 3 | var jasmine = require('../../lib/jasmine-1.0.1'); 4 | 5 | for(var key in jasmine) { 6 | global[key] = jasmine[key]; 7 | } 8 | 9 | //Patch Jasmine for proper stack traces 10 | jasmine.Spec.prototype.fail = function(e) { 11 | var expectationResult = new jasmine.ExpectationResult({ 12 | passed: false, 13 | message: e ? jasmine.util.formatException(e) : 'Exception' 14 | }); 15 | // PATCH 16 | if (e) { 17 | expectationResult.trace = e; 18 | } 19 | this.results_.addResult(expectationResult); 20 | }; 21 | 22 | 23 | 24 | var isVerbose = false; 25 | var showColors = true; 26 | process.argv.forEach(function(arg){ 27 | switch(arg) { 28 | case '--color': showColors = true; break; 29 | case '--noColor': showColors = false; break; 30 | case '--verbose': isVerbose = true; break; 31 | } 32 | }); 33 | 34 | jasmine.executeSpecsInFolder(__dirname, function(runner, log){ 35 | process.exit(runner.results().failedCount); 36 | }, isVerbose, showColors); 37 | -------------------------------------------------------------------------------- /docs/spec/writerSpec.js: -------------------------------------------------------------------------------- 1 | var writer = require('../src/writer.js'); 2 | describe('writer', function() { 3 | describe('toString', function() { 4 | var toString = writer.toString; 5 | 6 | it('should merge string', function() { 7 | expect(toString('abc')).toEqual('abc'); 8 | }); 9 | 10 | it('should merge obj', function() { 11 | expect(toString({a:1})).toEqual('{"a":1}'); 12 | }); 13 | 14 | it('should merge array', function() { 15 | expect(toString(['abc',{}])).toEqual('abc{}'); 16 | }); 17 | }); 18 | 19 | describe('replace method', function() { 20 | var content, 21 | replacements; 22 | 23 | beforeEach(function() { 24 | content = 'angular super jQuery manifest'; 25 | }); 26 | 27 | it('should replace placeholders', function() { 28 | replacements = {'angular': 'ng', 'jQuery': 'jqlite','notHere': 'here'}; 29 | 30 | content = writer.replace(content, replacements); 31 | expect(content).toBe('ng super jqlite manifest'); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /docs/src/SiteMap.js: -------------------------------------------------------------------------------- 1 | exports.SiteMap = SiteMap; 2 | 3 | /** 4 | * @see http://www.sitemaps.org/protocol.php 5 | * 6 | * @param docs 7 | * @returns {SiteMap} 8 | */ 9 | function SiteMap(docs){ 10 | this.render = function() { 11 | var map = []; 12 | map.push(''); 13 | map.push(''); 14 | docs.forEach(function(doc){ 15 | map.push(' http://docs.angularjs.org/' + 16 | encode(doc.section) + '/' + 17 | encode(doc.id) + 18 | 'weekly'); 19 | }); 20 | map.push(''); 21 | map.push(''); 22 | return map.join('\n'); 23 | }; 24 | 25 | function encode(text){ 26 | return text 27 | .replace(/&/mg, '&') 28 | .replace(//mg, '>') 30 | .replace(/'/mg, ''') 31 | .replace(/"/mg, '"'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/src/ignore.words: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/src/ignore.words -------------------------------------------------------------------------------- /docs/src/templates/.htaccess: -------------------------------------------------------------------------------- 1 | ## OFFLINE SUPPORT ## 2 | 3 | # These rules tell apache to check if there is a cookie called "offline", with value set to the 4 | # current angular version. If this rule matches the appcache-offline.manifest will be served for 5 | # requests to appcache.manifest 6 | # 7 | # This file must be processed by Grunt in order to replace %ANGULAR_VERSION% with the actual version. 8 | 9 | Options -Indexes 10 | RewriteEngine on 11 | RewriteCond %{HTTP_COOKIE} ng-offline="NG_VERSION_FULL" 12 | RewriteRule appcache.manifest appcache-offline.manifest 13 | 14 | ## Redirect to the latest manifest 15 | RewriteCond %{HTTP_HOST} ^docs-next\.angularjs\.org$ 16 | RewriteRule appcache.manifest http://code.angularjs.org/next/docs/appcache.manifest [R=301] 17 | 18 | ## HTML5 URL Support ## 19 | RewriteRule ^(guide|api|cookbook|misc|tutorial)(/.*)?$ index.html 20 | -------------------------------------------------------------------------------- /docs/src/templates/docs-scenario.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AngularJS Docs E2E Test Runner 5 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/src/templates/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/src/templates/favicon.ico -------------------------------------------------------------------------------- /docs/src/templates/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/src/templates/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/src/templates/font/fontawesome-webfont.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/src/templates/font/fontawesome-webfont.svgz -------------------------------------------------------------------------------- /docs/src/templates/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/src/templates/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/src/templates/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/docs/src/templates/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/src/templates/js/jquery.js: -------------------------------------------------------------------------------- 1 | ../../../../lib/jquery/jquery.js -------------------------------------------------------------------------------- /docs/src/templates/js/jquery.min.js: -------------------------------------------------------------------------------- 1 | ../../../../lib/jquery/jquery.min.js -------------------------------------------------------------------------------- /docs/src/templates/offline.html: -------------------------------------------------------------------------------- 1 |

OFFLINE

2 | 3 |

This page is currently unavailable because your are offline.

4 |

Please connect to the Internet and reload the page.

5 | -------------------------------------------------------------------------------- /example/buzz/buzz.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: -webkit-gradient(linear, left top, left 100, from(#bbb), to(#fff)); 3 | background-repeat: no-repeat; 4 | margin: 0px; 5 | font-family: sans-serif; 6 | font-size: 12px; 7 | } 8 | 9 | body > div { 10 | border-top: 1px solid white; 11 | border-bottom: 1px solid black; 12 | text-align: center; 13 | background: -webkit-gradient(linear, left top, left bottom, from(#CCC), to(#888)); 14 | -webkit-background-origin: padding; -webkit-background-clip: content; 15 | } 16 | body > div button { 17 | margin: 5px; 18 | } 19 | 20 | body > div span:FIRST-CHILD { 21 | float: left; 22 | font-family: monospace; 23 | font-size: 1.5em; 24 | color: black; 25 | padding: 2px 5px; 26 | } 27 | 28 | body > div span:last-child { 29 | float: right; 30 | } 31 | 32 | ul { 33 | list-style: none; 34 | padding: 10px; 35 | margin: 0; 36 | } 37 | 38 | body > ul > li { 39 | border: 1px solid black; 40 | margin: 15px 5px; 41 | padding: 0; 42 | -webkit-box-shadow: 5px 5px 5px #888; 43 | } 44 | 45 | body > ul > li > h1 { 46 | margin: 0; 47 | background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#999)); 48 | font-size: 13px; 49 | border-bottom: 1px solid black; 50 | } 51 | 52 | h1 > img, 53 | li > img { 54 | max-height: 30px; 55 | max-width: 30px; 56 | vertical-align: middle; 57 | padding: 3px; 58 | } 59 | 60 | a > img { 61 | margin-right: 5px; 62 | margin-top: 5px; 63 | } 64 | 65 | body > ul > li > h1 > a:last-child { 66 | float: right; 67 | margin: 10px; 68 | } 69 | 70 | body > ul > li > div { 71 | background-color: white; 72 | background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ddd)); 73 | margin: 0; 74 | padding: 10px; 75 | } 76 | 77 | body > ul > li ul { 78 | margin: 0; 79 | padding: 0; 80 | margin-left: 5px; 81 | border-left: 5px solid lightgray; 82 | } 83 | 84 | body > ul > li ul > li { 85 | margin: 0; 86 | padding: 10px; 87 | background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ddd)); 88 | } 89 | 90 | -------------------------------------------------------------------------------- /example/buzz/buzz.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | <angular/> Buzz 13 | 14 | filter: 15 | 16 | 17 | 18 | user: 19 | 20 | 21 | 22 |
23 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /example/buzz/buzz.js: -------------------------------------------------------------------------------- 1 | angular.module.ng('myApplication', function($resource){ 2 | this.Activity = $resource( 3 | 'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments', 4 | {alt:'json', callback:'JSON_CALLBACK'}, 5 | { 6 | get: {method:'JSON', params:{visibility:'@self'}}, 7 | replies: {method:'JSON', params:{visibility:'@self', comments:'@comments'}} 8 | }); 9 | }, {inject:['$resource']}); 10 | 11 | function BuzzController() { 12 | this.$watch('$location.hashPath', this.userChange); 13 | } 14 | BuzzController.prototype = { 15 | userChange: function() { 16 | this.userId = this.$location.hashPath; 17 | this.activities = this.Activity.get({userId:this.userId}); 18 | }, 19 | 20 | expandReplies: function(activity) { 21 | var self = this; 22 | if (activity.replies) { 23 | activity.replies.show = !activity.replies.show; 24 | } else { 25 | activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id}, function() { 26 | activity.replies.show = true; 27 | }); 28 | } 29 | } 30 | }; 31 | 32 | angular.widget('my:expand', function(element){ 33 | element.css('display', 'block'); 34 | this.descend(true); 35 | return function(element) { 36 | element.hide(); 37 | var watch = element.attr('expand'); 38 | this.$watch(watch, function(value){ 39 | if (value) { 40 | element.delay(0).slideDown('slow'); 41 | } else { 42 | element.slideUp('slow'); 43 | } 44 | }); 45 | }; 46 | }); 47 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example/personalLog/personalLog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Personal Log 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 |
22 | 23 |
24 |

Logs:

25 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/personalLog/personalLog.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Very simple personal log demo application to demonstrate angular functionality, 3 | * especially: 4 | * - the MVC model 5 | * - testability of controllers 6 | * - dependency injection for controllers via $inject and constructor function 7 | * - $cookieStore for persistent cookie-backed storage 8 | * - simple templating constructs such as ng-repeat and {{}} 9 | * - date filter 10 | * - and binding onSubmit and onClick events to angular expressions 11 | * @author Igor Minar 12 | */ 13 | 14 | //name space isolating closure 15 | (function() { 16 | 17 | var app = angular.module('personalLog', ['ngCookies']); 18 | 19 | var LOGS = 'logs'; 20 | 21 | /** 22 | * The controller for the personal log app. 23 | */ 24 | app.controller('LogCtrl', ['$cookieStore', '$scope', function LogCtrl($cookieStore, $scope) { 25 | 26 | var logs = $scope.logs = $cookieStore.get(LOGS) || []; //main model 27 | 28 | 29 | /** 30 | * Adds newMsg to the logs array as a log, persists it and clears newMsg. 31 | * @param {string} msg Message to add (message is passed as parameter to make testing easier). 32 | */ 33 | $scope.addLog = function(msg) { 34 | var newMsg = msg || $scope.newMsg; 35 | if (!newMsg) return; 36 | var log = { 37 | at: new Date().getTime(), 38 | msg: newMsg 39 | }; 40 | 41 | logs.push(log); 42 | $cookieStore.put(LOGS, logs); 43 | $scope.newMsg = ''; 44 | }; 45 | 46 | 47 | /** 48 | * Persistently removes a log from logs. 49 | * @param {object} log The log to remove. 50 | */ 51 | $scope.rmLog = function(log) { 52 | for ( var i = 0; i < logs.length; i++) { 53 | if (log === logs[i]) { 54 | logs.splice(i, 1); 55 | break; 56 | } 57 | } 58 | 59 | $cookieStore.put(LOGS, logs); 60 | }; 61 | 62 | 63 | /** 64 | * Persistently removes all logs. 65 | */ 66 | $scope.rmLogs = function() { 67 | logs.splice(0, logs.length); 68 | $cookieStore.remove(LOGS); 69 | }; 70 | }]); 71 | 72 | })(); 73 | -------------------------------------------------------------------------------- /example/personalLog/scenario/runner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Personal Log Scenario Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example/temp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | angular dev sandbox 5 | 6 | 19 | 20 | 21 | 22 |

23 | view1 | view2 | blank 24 |

25 | 26 |
27 | 28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /example/tweeter/style.css: -------------------------------------------------------------------------------- 1 | .loading {display: none;} 2 | .fetching .loading {display: block;} 3 | 4 | a { 5 | color: blue; 6 | } 7 | 8 | h1 { 9 | background-color: black; 10 | margin: 0; 11 | padding: .25em; 12 | color: white; 13 | border-bottom: 5px solid gray; 14 | } 15 | 16 | .box { 17 | border: 2px solid gray; 18 | } 19 | 20 | .tweeter { 21 | margin-right: 360px; 22 | } 23 | 24 | ul { 25 | list-style: none; 26 | margin: 0; 27 | padding: 0; 28 | } 29 | 30 | li { 31 | margin: .25em; 32 | padding: 2px; 33 | } 34 | 35 | li img { 36 | float: left; 37 | margin: 2px; 38 | margin-right: .5em; 39 | max-height: 48px; 40 | min-height: 48px; 41 | } 42 | 43 | li.even { 44 | background-color: lightgray; 45 | } 46 | 47 | 48 | .addressbook { 49 | float: right; 50 | width: 350px; 51 | } 52 | 53 | .addressbook li { 54 | font-size: .9em; 55 | } 56 | 57 | .clrleft { 58 | clear: left; 59 | } 60 | 61 | .notes { 62 | font-size: .8em; 63 | color: gray; 64 | } 65 | 66 | .username, .nickname { 67 | font-weight: bold; 68 | } 69 | 70 | .editor { 71 | padding: 4px; 72 | } 73 | 74 | label { 75 | color: gray; 76 | display: inline-block; 77 | width: 75px; 78 | text-align: right; 79 | padding: 2px; 80 | margin-top: 10px; 81 | } 82 | 83 | .editor input[type=text], 84 | .editor textarea { 85 | width: 230px; 86 | vertical-align: text-top; 87 | } 88 | 89 | .editor TEXTAREA { 90 | height: 50px; 91 | } 92 | 93 | .debug{ 94 | font-size: .7em; 95 | white-space: pre; 96 | padding: 0; 97 | margin: 0; 98 | } -------------------------------------------------------------------------------- /example/tweeter/tweeter_demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | (TODO: I should fetch current tweets) 13 |
14 |

Tweets: {{$anchor.user}}

15 | [ Filter: (TODO: this should act as search box) 16 | | << All 17 | ] 18 |
Loading...
19 | 31 |
32 |
tweets=(TODO: display me!!!)
33 | 34 | 35 | -------------------------------------------------------------------------------- /example/tweeter/tweeterclient.js: -------------------------------------------------------------------------------- 1 | function noop() {} 2 | $(document).ready(function() { 3 | function xhr(method, url, data, callback){ 4 | jQuery.getJSON(url, function() { 5 | callback.apply(this, arguments); 6 | scope.updateView(); 7 | }); 8 | } 9 | 10 | var resourceFactory = new ResourceFactory(xhr); 11 | 12 | var Tweeter = resourceFactory.route("http://twitter.com/statuses/:service:username.json", {}, { 13 | home: {method:'GET', params: {service:'home_timeline'}, isArray:true }, 14 | user: {method:'GET', params: {service:'user_timeline/'}, isArray:true } 15 | }); 16 | 17 | 18 | var scope = window.scope = angular.compile(document, { 19 | location:angular.startUrlWatcher() 20 | }); 21 | 22 | function fetchTweets(username){ 23 | return username ? Tweeter.user({username: username}) : Tweeter.home(); 24 | } 25 | 26 | scope.set('fetchTweets', fetchTweets); 27 | scope.set('users', [ 28 | {screen_name:'mhevery', name:'Mi\u0161ko Hevery', 29 | notes:'Author of http://www.getangular.com.', 30 | profile_image_url:'http://a3.twimg.com/profile_images/54360179/Me_-_Small_Banner_normal.jpg'}, 31 | {screen_name:'abrons', name:'Adam Abrons', 32 | notes:'Author of & Ruby guru see: http://www.angularjs.org.', 33 | profile_image_url:'http://media.linkedin.com/mpr/mpr/shrink_80_80/p/2/000/005/0a8/044278d.jpg'} 34 | ]); 35 | scope.init(); 36 | }); 37 | -------------------------------------------------------------------------------- /example/view1.html: -------------------------------------------------------------------------------- 1 | view1
2 | location: {{url()}} 3 | -------------------------------------------------------------------------------- /example/view2.html: -------------------------------------------------------------------------------- 1 | view2
2 | location: {{url()}}
3 | -------------------------------------------------------------------------------- /gen_docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | JASMINE_NODE='jasmine-node' 4 | local_jasmine='./node_modules/.bin/jasmine-node' 5 | 6 | if ! type -p "$JASMINE_NODE" >/dev/null 2>&1;then 7 | if [[ -x "$local_jasmine" ]];then 8 | JASMINE_NODE="$local_jasmine" 9 | else 10 | echo 'Could not find a locally or globally installed executable of' \ 11 | 'jasmine-node. Try: `npm install jasmine-node`.' >&2 12 | exit 1 13 | fi 14 | fi 15 | 16 | if [[ ! -e gen_docs.disable ]]; then 17 | echo 'Testing, then building documentation...' 18 | "$JASMINE_NODE" docs/spec --noColor && node docs/src/gen-docs.js 19 | fi 20 | -------------------------------------------------------------------------------- /i18n/README.md: -------------------------------------------------------------------------------- 1 | # i18n directory overview: 2 | 3 | - closure/ - closure files we use for ruleset generation 4 | - locale/ - angular's locale ruleset files 5 | - src/ - source files 6 | - spec/ - spec files for stuff in src directory 7 | - generate.sh - runs src scripts on closure dir and stores output in locale dir 8 | - update-closure.sh - downloads the latest version of closure files from public svn repo 9 | 10 | The closure files (maintained by Shanjian Li (shanjian)) change very rarely, so we don't need to 11 | regenerate locale files very often. 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /i18n/e2e/localeTest_en.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | locale test 6 | 7 | 10 | 19 | 20 | 21 |

Datetime/Number/Currency filters demo:

22 |
23 | date(medium): {{input | date:"medium"}}
24 | date(longDate): {{input | date:"longDate"}}
25 | number: {{input | number}}
26 | currency: {{input | currency }} 27 |
28 |

Pluralization demo:

29 |
30 | 34 | 35 |
36 |

Pluralization demo with offsets:

37 | Name of person1:
38 | Name of person2:
39 |
40 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /i18n/e2e/localeTest_zh.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | locale test 6 | 7 | 8 | 17 | 18 | 19 |

Datetime/Number/Currency filters demo:

20 |
21 | date(medium): {{input | date:"medium"}}
22 | date(longDate): {{input | date:"longDate"}}
23 | number: {{input | number}}
24 | currency: {{input | currency }} 25 |
26 |

Pluralization demo:

27 |
28 | 30 | 31 |
32 |

Pluralization demo with offsets:

33 | Name of person1:
34 | Name of person2:
35 |
36 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /i18n/e2e/runner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <angular/> Docs Scenario Runner 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /i18n/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`dirname $0` 4 | cd $BASE_DIR 5 | 6 | 7 | /usr/bin/env jasmine-node spec/ --noColor && node src/closureSlurper.js 8 | -------------------------------------------------------------------------------- /i18n/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | PARENT_DIR="$(dirname "$0")" 5 | jasmine-node "$PARENT_DIR"/spec/ 6 | -------------------------------------------------------------------------------- /i18n/spec/converterSpec.js: -------------------------------------------------------------------------------- 1 | var converter = require('../src/converter.js'); 2 | 3 | describe("convertNumberData", function() { 4 | var convert = converter.convertNumberData, 5 | dataObj = { DECIMAL_SEP: ',', 6 | GROUP_SEP: '.', 7 | DECIMAL_PATTERN: '#,##0.###;#,##0.###-', 8 | CURRENCY_PATTERN: '\u00A4#,##0.00;\u00A4#,##0.00-', 9 | DEF_CURRENCY_CODE: 'USD' }; 10 | 11 | it('should convert number object', function() { 12 | var processedData = convert(dataObj, {USD: ['x', '$', 'y']}); 13 | expect(processedData.DECIMAL_SEP).toBe(','); 14 | expect(processedData.GROUP_SEP).toBe('.'); 15 | expect(processedData.PATTERNS.length).toBe(2); 16 | expect(processedData.PATTERNS[0].gSize).toBe(3); 17 | expect(processedData.PATTERNS[0].negSuf).toBe('-'); 18 | expect(processedData.CURRENCY_SYM).toBe('$'); 19 | 20 | dataObj.DEF_CURRENCY_CODE = 'NoSuchCode'; 21 | processedData = convert(dataObj, {}); 22 | expect(processedData.CURRENCY_SYM).toBe('NoSuchCode'); 23 | }); 24 | }); 25 | 26 | 27 | describe("convertDatetimeData", function() { 28 | var convert = converter.convertDatetimeData, 29 | dataObj = { MONTHS: ['Enero', 'Pebrero'], 30 | SHORTMONTHS: ['Ene', 'Peb'], 31 | WEEKDAYS: ['Linggo', 'Lunes'], 32 | SHORTWEEKDAYS: ['Lin', 'Lun'], 33 | AMPMS: ['AM', 'PM'], 34 | DATEFORMATS: ['a', 'b', 'c', 'd'], 35 | TIMEFORMATS: ['e', 'f', 'g', 'h'] }; 36 | 37 | it('should convert empty datetime obj', function() { 38 | var processedData = convert(dataObj); 39 | expect(processedData.MONTH).toEqual(['Enero', 'Pebrero']); 40 | expect(processedData.SHORTMONTH).toEqual(['Ene', 'Peb']); 41 | expect(processedData.DAY).toEqual(['Linggo', 'Lunes']); 42 | expect(processedData.SHORTDAY).toEqual(['Lin', 'Lun']); 43 | expect(processedData.AMPMS).toEqual(['AM', 'PM']); 44 | expect(processedData.medium).toBe('c g'); 45 | expect(processedData.short).toBe('d h'); 46 | expect(processedData.fullDate).toBe('a'); 47 | expect(processedData.longDate).toBe('b'); 48 | expect(processedData.mediumDate).toBe('c'); 49 | expect(processedData.shortDate).toBe('d'); 50 | expect(processedData.mediumTime).toBe('g'); 51 | expect(processedData.shortTime).toBe('h'); 52 | }); 53 | }); 54 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /i18n/src/converter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * after obtaining data from closure files, use converter to massage the data into the formats 3 | * we want 4 | */ 5 | exports.convertDatetimeData = convertDatetimeData; 6 | exports.convertNumberData = convertNumberData; 7 | 8 | 9 | var parsePattern = require('./parser').parsePattern; 10 | 11 | 12 | function convertNumberData(dataObj, currencySymbols) { 13 | var numberFormats = {}, 14 | 15 | numberFormats = { 16 | DECIMAL_SEP: dataObj.DECIMAL_SEP, 17 | GROUP_SEP: dataObj.GROUP_SEP, 18 | PATTERNS: [parsePattern(dataObj.DECIMAL_PATTERN), 19 | parsePattern(dataObj.CURRENCY_PATTERN)] 20 | } 21 | 22 | if (currencySymbols[dataObj.DEF_CURRENCY_CODE]) { 23 | numberFormats.CURRENCY_SYM = currencySymbols[dataObj.DEF_CURRENCY_CODE][1]; 24 | } else { 25 | if (dataObj.DEF_CURRENCY_CODE == 'MTL') { 26 | numberFormats.CURRENCY_SYM = '₤'; //for some reason this is missing in closure 27 | } else { 28 | // if there is no corresponding currency symbol, just use currency code. 29 | var code = numberFormats.CURRENCY_SYM = dataObj.DEF_CURRENCY_CODE; 30 | console.log(code +' has no currency symbol in closure, used ' + code + ' instead!'); 31 | } 32 | } 33 | return numberFormats; 34 | } 35 | 36 | 37 | function convertDatetimeData(dataObj) { 38 | var datetimeFormats = {}; 39 | 40 | datetimeFormats.MONTH = dataObj.MONTHS; 41 | datetimeFormats.SHORTMONTH = dataObj.SHORTMONTHS; 42 | datetimeFormats.DAY = dataObj.WEEKDAYS; 43 | datetimeFormats.SHORTDAY = dataObj.SHORTWEEKDAYS; 44 | datetimeFormats.AMPMS = dataObj.AMPMS; 45 | 46 | 47 | datetimeFormats.medium = dataObj.DATEFORMATS[2] + ' ' + dataObj.TIMEFORMATS[2]; 48 | datetimeFormats.short = dataObj.DATEFORMATS[3] + ' ' + dataObj.TIMEFORMATS[3]; 49 | datetimeFormats.fullDate = dataObj.DATEFORMATS[0]; 50 | datetimeFormats.longDate = dataObj.DATEFORMATS[1]; 51 | datetimeFormats.mediumDate = dataObj.DATEFORMATS[2]; 52 | datetimeFormats.shortDate = dataObj.DATEFORMATS[3]; 53 | datetimeFormats.mediumTime = dataObj.TIMEFORMATS[2]; 54 | datetimeFormats.shortTime = dataObj.TIMEFORMATS[3]; 55 | 56 | return datetimeFormats; 57 | } 58 | -------------------------------------------------------------------------------- /i18n/src/parser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple parser to parse a number format into a pattern object 3 | */ 4 | 5 | exports.parsePattern = parsePattern; 6 | 7 | var PATTERN_SEP = ';', 8 | DECIMAL_SEP = '.', 9 | GROUP_SEP = ',', 10 | ZERO = '0', 11 | DIGIT = '#'; 12 | 13 | /** 14 | * main funciton for parser 15 | * @param str {string} pattern to be parsed (e.g. #,##0.###). 16 | */ 17 | function parsePattern(pattern) { 18 | var p = { 19 | minInt: 1, 20 | minFrac: 0, 21 | macFrac: 0, 22 | posPre: '', 23 | posSuf: '', 24 | negPre: '', 25 | negSuf: '', 26 | gSize: 0, 27 | lgSize: 0 28 | }; 29 | 30 | var parts = pattern.split(PATTERN_SEP), 31 | positive = parts[0], 32 | negative = parts[1]; 33 | 34 | var parts = positive.split(DECIMAL_SEP), 35 | integer = parts[0], 36 | fraction = parts[1]; 37 | 38 | p.posPre = integer.substr(0, integer.indexOf(DIGIT)); 39 | 40 | for (var i = 0; i < fraction.length; i++) { 41 | var ch = fraction.charAt(i); 42 | if (ch == ZERO) p.minFrac = p.maxFrac = i + 1; 43 | else if (ch == DIGIT) p.maxFrac = i + 1; 44 | else p.posSuf += ch; 45 | } 46 | 47 | var groups = integer.split(GROUP_SEP); 48 | p.gSize = groups[1] ? groups[1].length : 0; 49 | p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0; 50 | 51 | if (negative) { 52 | var trunkLen = positive.length - p.posPre.length - p.posSuf.length, 53 | pos = negative.indexOf(DIGIT); 54 | 55 | p.negPre = negative.substr(0, pos).replace(/\'/g, ''); 56 | p.negSuf = negative.substr(pos + trunkLen).replace(/\'/g, ''); 57 | } else { 58 | // hardcoded '-' sign is fine as all locale use '-' as MINUS_SIGN. (\u2212 is the same as '-') 59 | p.negPre = p.posPre + '-'; 60 | p.negSuf = p.posSuf; 61 | } 62 | 63 | return p; 64 | } 65 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | curl http://closure-library.googlecode.com/svn/trunk/closure/goog/i18n/currency.js > closure/currencySymbols.js 11 | curl http://closure-library.googlecode.com/svn/trunk/closure/goog/i18n/datetimesymbols.js > closure/datetimeSymbols.js 12 | curl http://closure-library.googlecode.com/svn/trunk/closure/goog/i18n/datetimesymbolsext.js > closure/datetimeSymbolsExt.js 13 | curl http://closure-library.googlecode.com/svn/trunk/closure/goog/i18n/numberformatsymbols.js > closure/numberSymbols.js 14 | curl http://closure-library.googlecode.com/svn/trunk/closure/goog/i18n/pluralrules.js > closure/pluralRules.js 15 | -------------------------------------------------------------------------------- /images/css/arrow_left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/css/arrow_left.gif -------------------------------------------------------------------------------- /images/css/arrow_right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/css/arrow_right.gif -------------------------------------------------------------------------------- /images/css/indicator-wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/css/indicator-wait.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/Diagrams.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/Diagrams.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/Diagrams.graffle/image1.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/Diagrams.graffle/image2.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/Diagrams.graffle/image4.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/Diagrams.graffle/image8.png -------------------------------------------------------------------------------- /images/docs/Diagrams.graffle/image9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/Diagrams.graffle/image9.png -------------------------------------------------------------------------------- /images/docs/guide/about_view.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/about_view.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/guide/about_view.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/about_view.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/guide/about_view.graffle/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/about_view.graffle/image3.png -------------------------------------------------------------------------------- /images/docs/guide/concepts.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/concepts.graffle/image1.png -------------------------------------------------------------------------------- /images/docs/guide/concepts.graffle/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/concepts.graffle/image4.png -------------------------------------------------------------------------------- /images/docs/guide/concepts.graffle/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/concepts.graffle/image5.png -------------------------------------------------------------------------------- /images/docs/guide/simple_scope.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/simple_scope.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/guide/simple_scope.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/simple_scope.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/guide/simple_scope.graffle/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/guide/simple_scope.graffle/image7.png -------------------------------------------------------------------------------- /images/docs/tutorial/simple_scope.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/simple_scope.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/simple_scope.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/simple_scope.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/simple_scope.graffle/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/simple_scope.graffle/image7.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_02.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_02.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_02.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_02.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_02.graffle/image11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_02.graffle/image11.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_03.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_03.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_03.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_03.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_03.graffle/image13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_03.graffle/image13.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_04.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_04.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_04.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_04.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_04.graffle/image15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_04.graffle/image15.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_07.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_07.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_07.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_07.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_07.graffle/image9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_07.graffle/image9.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_08-09.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_08-09.graffle/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_08-09.graffle/image10.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_10-11.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_10-11.graffle/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_10-11.graffle/image10.png -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_proto.graffle/QuickLook/Preview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_proto.graffle/QuickLook/Preview.pdf -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_proto.graffle/QuickLook/Thumbnail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_proto.graffle/QuickLook/Thumbnail.tiff -------------------------------------------------------------------------------- /images/docs/tutorial/tutorial_proto.graffle/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/docs/tutorial/tutorial_proto.graffle/image7.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/favicon.ico -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-huge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS-Shield.exports/AngularJS-Shield-huge.png -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS-Shield.exports/AngularJS-Shield-large.png -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS-Shield.exports/AngularJS-Shield-medium.png -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS-Shield.exports/AngularJS-Shield-small.png -------------------------------------------------------------------------------- /images/logo/AngularJS-Shield.exports/AngularJS-Shield.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS-Shield.exports/AngularJS-Shield.pdf -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-huge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.exports/AngularJS-huge.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.exports/AngularJS-large.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.exports/AngularJS-medium.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.exports/AngularJS-small.png -------------------------------------------------------------------------------- /images/logo/AngularJS.exports/AngularJS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.exports/AngularJS.pdf -------------------------------------------------------------------------------- /images/logo/AngularJS.graffle/data.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.graffle/data.plist -------------------------------------------------------------------------------- /images/logo/AngularJS.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.graffle/image1.png -------------------------------------------------------------------------------- /images/logo/AngularJS.graffle/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/images/logo/AngularJS.graffle/image2.png -------------------------------------------------------------------------------- /init-repo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Script to initialize angular repo 4 | # - install required node packages 5 | # - install Testacular 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 | testacular=`which testacular 2>&1` 26 | if [ $? -ne 0 ]; then 27 | echo "Installing Testacular..." 28 | npm install -g testacular 29 | fi 30 | 31 | echo "Installing git hooks..." 32 | ln -sf ../../validate-commit-msg.js .git/hooks/commit-msg 33 | -------------------------------------------------------------------------------- /lib/closure-compiler/compiler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajoslin/angular.js/23abb990f10270f7992429ef83f86b83c91f75ea/lib/closure-compiler/compiler.jar -------------------------------------------------------------------------------- /lib/closure-compiler/version.txt: -------------------------------------------------------------------------------- 1 | 20110615 2 | -------------------------------------------------------------------------------- /lib/grunt/plugins.js: -------------------------------------------------------------------------------- 1 | var util = require('./utils.js'); 2 | var spawn = require('child_process').spawn; 3 | 4 | module.exports = function(grunt) { 5 | 6 | grunt.registerMultiTask('min', 'minify JS files', function(){ 7 | util.min.call(util, this.data, this.async()); 8 | }); 9 | 10 | 11 | grunt.registerTask('minall', 'minify all the JS files in parallel', function(){ 12 | var files = grunt.config('min'); 13 | files = Object.keys(files).map(function(key){ return files[key]; }); 14 | grunt.util.async.forEach(files, util.min.bind(util), this.async()); 15 | }); 16 | 17 | 18 | grunt.registerMultiTask('build', 'build JS files', function(){ 19 | util.build.call(util, this.data, this.async()); 20 | }); 21 | 22 | 23 | grunt.registerTask('buildall', 'build all the JS files in parallel', function(){ 24 | var builds = grunt.config('build'); 25 | builds = Object.keys(builds).map(function(key){ return builds[key]; }); 26 | grunt.util.async.forEach(builds, util.build.bind(util), this.async()); 27 | }); 28 | 29 | 30 | grunt.registerMultiTask('write', 'write content to a file', function(){ 31 | grunt.file.write(this.data.file, this.data.val); 32 | grunt.log.ok('wrote to ' + this.data.file); 33 | }); 34 | 35 | 36 | grunt.registerMultiTask('docs', 'create angular docs', function(){ 37 | var done = this.async(); 38 | var files = this.data; 39 | var docs = spawn('node', ['docs/src/gen-docs.js']); 40 | docs.stdout.pipe(process.stdout); 41 | docs.stderr.pipe(process.stderr); 42 | docs.on('exit', function(code){ 43 | if(code !== 0) grunt.fail.warn('Error creating docs'); 44 | grunt.file.expand(files).forEach(function(file){ 45 | grunt.file.write(file, util.process(grunt.file.read(file), grunt.config('NG_VERSION'), false)); 46 | }); 47 | grunt.log.ok('docs created'); 48 | done(); 49 | }); 50 | }); 51 | 52 | 53 | grunt.registerMultiTask('test', 'Run the unit tests with testacular', function(){ 54 | util.startTestacular.call(util, this.data, true, this.async()); 55 | }); 56 | 57 | 58 | grunt.registerMultiTask('autotest', 'Run and watch the unit tests with testacular', function(){ 59 | util.startTestacular.call(util, this.data, false, this.async()); 60 | }); 61 | }; 62 | -------------------------------------------------------------------------------- /lib/jquery/version.txt: -------------------------------------------------------------------------------- 1 | 1.8.2 2 | -------------------------------------------------------------------------------- /lib/showdown/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var vm = require('vm'); 3 | 4 | var filename = __dirname + '/showdown-0.9.js'; 5 | var src = fs.readFileSync(filename); 6 | var Showdown = vm.runInThisContext(src + '\nShowdown;', filename); 7 | exports.Showdown = Showdown; 8 | -------------------------------------------------------------------------------- /logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AngularJS", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "grunt": "0.4.0", 6 | "grunt-contrib-clean": "0.4.0", 7 | "grunt-contrib-compress": "0.4.1", 8 | "grunt-contrib-connect": "0.1.2", 9 | "grunt-contrib-copy": "0.4.0", 10 | "jasmine-node": "1.2.3", 11 | "q": "~0.9.2", 12 | "q-fs": "0.1.36", 13 | "qq": "0.3.5", 14 | "shelljs": "0.1.2", 15 | "testacular": "0.5.9", 16 | "yaml-js": "0.0.5" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /release-commit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function catch_errors() { 4 | echo "ERROR. That's life." 5 | exit 1 6 | } 7 | 8 | trap catch_errors ERR 9 | 10 | TMP_FILE='changelog.tmp' 11 | CHANGELOG_FILE='CHANGELOG.md' 12 | 13 | echo "Getting current version..." 14 | VERSION=`./version.js --current` 15 | 16 | echo "Generating changelog..." 17 | ./changelog.js $VERSION $TMP_FILE 18 | 19 | cat $CHANGELOG_FILE >> $TMP_FILE 20 | mv -f $TMP_FILE $CHANGELOG_FILE 21 | 22 | 23 | echo "Updating version..." 24 | ./version.js --remove-snapshot 25 | 26 | echo "CONFIRM TO COMMIT" 27 | read WHATEVER 28 | 29 | 30 | echo "Creating commit..." 31 | git commit version.yaml CHANGELOG.md -m "chore(relase): cutting the v$VERSION release" 32 | 33 | echo "Creating tag..." 34 | git tag "v$VERSION" 35 | -------------------------------------------------------------------------------- /src/angular.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2012 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window, document, undefined) { 7 | -------------------------------------------------------------------------------- /src/angular.suffix: -------------------------------------------------------------------------------- 1 | //try to bind to jquery now so that one can write angular.element().read() 2 | //but we will rebind on bootstrap again. 3 | bindJQuery(); 4 | 5 | publishExternalAPI(angular); 6 | 7 | jqLite(document).ready(function() { 8 | angularInit(document, bootstrap); 9 | }); 10 | 11 | })(window, document); 12 | -------------------------------------------------------------------------------- /src/bootstrap/google-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .linenums .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 18px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /src/loader.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2012 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | 'use strict'; 7 | ( 8 | -------------------------------------------------------------------------------- /src/loader.suffix: -------------------------------------------------------------------------------- 1 | )(window); 2 | 3 | /** 4 | * Closure compiler type information 5 | * 6 | * @typedef { { 7 | * requires: !Array., 8 | * invokeQueue: !Array.>, 9 | * 10 | * service: function(string, Function):angular.Module, 11 | * factory: function(string, Function):angular.Module, 12 | * value: function(string, *):angular.Module, 13 | * 14 | * filter: function(string, Function):angular.Module, 15 | * 16 | * init: function(Function):angular.Module 17 | * } } 18 | */ 19 | angular.Module; 20 | 21 | -------------------------------------------------------------------------------- /src/module.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2012 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window, angular, undefined) { 7 | -------------------------------------------------------------------------------- /src/module.suffix: -------------------------------------------------------------------------------- 1 | 2 | })(window, window.angular); 3 | -------------------------------------------------------------------------------- /src/ng/directive/a.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ng.directive:a 6 | * @restrict E 7 | * 8 | * @description 9 | * Modifies the default behavior of html A tag, so that the default action is prevented when href 10 | * attribute is empty. 11 | * 12 | * The reasoning for this change is to allow easy creation of action links with `ngClick` directive 13 | * without changing the location or causing page reloads, e.g.: 14 | * `Save` 15 | */ 16 | var htmlAnchorDirective = valueFn({ 17 | restrict: 'E', 18 | compile: function(element, attr) { 19 | 20 | if (msie <= 8) { 21 | 22 | // turn link into a stylable link in IE 23 | // but only if it doesn't have name attribute, in which case it's an anchor 24 | if (!attr.href && !attr.name) { 25 | attr.$set('href', ''); 26 | } 27 | 28 | // add a comment node to anchors to workaround IE bug that causes element content to be reset 29 | // to new attribute content if attribute is updated with value containing @ and element also 30 | // contains value with @ 31 | // see issue #1949 32 | element.append(document.createComment('IE fix')); 33 | } 34 | 35 | return function(scope, element) { 36 | element.bind('click', function(event){ 37 | // if we have no href url, then don't navigate anywhere. 38 | if (!element.attr('href')) { 39 | event.preventDefault(); 40 | } 41 | }); 42 | } 43 | } 44 | }); 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/ng/directive/ngCsp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ng.directive:ngCsp 6 | * @priority 1000 7 | * 8 | * @description 9 | * Enables [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) support. 10 | * This directive should be used on the root element of the application (typically the `` 11 | * element or other element with the {@link ng.directive:ngApp ngApp} 12 | * directive). 13 | * 14 | * If enabled the performance of template expression evaluator will suffer slightly, so don't enable 15 | * this mode unless you need it. 16 | * 17 | * @element html 18 | */ 19 | 20 | var ngCspDirective = ['$sniffer', function($sniffer) { 21 | return { 22 | priority: 1000, 23 | compile: function() { 24 | $sniffer.csp = true; 25 | } 26 | }; 27 | }]; 28 | -------------------------------------------------------------------------------- /src/ng/directive/ngInit.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ng.directive:ngInit 6 | * 7 | * @description 8 | * The `ngInit` directive specifies initialization tasks to be executed 9 | * before the template enters execution mode during bootstrap. 10 | * 11 | * @element ANY 12 | * @param {expression} ngInit {@link guide/expression Expression} to eval. 13 | * 14 | * @example 15 | 16 | 17 |
18 | {{greeting}} {{person}}! 19 |
20 |
21 | 22 | it('should check greeting', function() { 23 | expect(binding('greeting')).toBe('Hello'); 24 | expect(binding('person')).toBe('World'); 25 | }); 26 | 27 |
28 | */ 29 | var ngInitDirective = ngDirective({ 30 | compile: function() { 31 | return { 32 | pre: function(scope, element, attrs) { 33 | scope.$eval(attrs.ngInit); 34 | } 35 | } 36 | } 37 | }); 38 | -------------------------------------------------------------------------------- /src/ng/directive/ngNonBindable.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ng.directive:ngNonBindable 6 | * @priority 1000 7 | * 8 | * @description 9 | * Sometimes it is necessary to write code which looks like bindings but which should be left alone 10 | * by angular. Use `ngNonBindable` to make angular ignore a chunk of HTML. 11 | * 12 | * @element ANY 13 | * 14 | * @example 15 | * In this example there are two location where a simple binding (`{{}}`) is present, but the one 16 | * wrapped in `ngNonBindable` is left alone. 17 | * 18 | * @example 19 | 20 | 21 |
Normal: {{1 + 2}}
22 |
Ignored: {{1 + 2}}
23 |
24 | 25 | it('should check ng-non-bindable', function() { 26 | expect(using('.doc-example-live').binding('1 + 2')).toBe('3'); 27 | expect(using('.doc-example-live').element('div:last').text()). 28 | toMatch(/1 \+ 2/); 29 | }); 30 | 31 |
32 | */ 33 | var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 }); 34 | -------------------------------------------------------------------------------- /src/ng/directive/ngStyle.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ng.directive:ngStyle 6 | * 7 | * @description 8 | * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally. 9 | * 10 | * @element ANY 11 | * @param {expression} ngStyle {@link guide/expression Expression} which evals to an 12 | * object whose keys are CSS style names and values are corresponding values for those CSS 13 | * keys. 14 | * 15 | * @example 16 | 17 | 18 | 19 | 20 |
21 | Sample Text 22 |
myStyle={{myStyle}}
23 |
24 | 25 | span { 26 | color: black; 27 | } 28 | 29 | 30 | it('should check ng-style', function() { 31 | expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)'); 32 | element('.doc-example-live :button[value=set]').click(); 33 | expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)'); 34 | element('.doc-example-live :button[value=clear]').click(); 35 | expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)'); 36 | }); 37 | 38 |
39 | */ 40 | var ngStyleDirective = ngDirective(function(scope, element, attr) { 41 | scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) { 42 | if (oldStyles && (newStyles !== oldStyles)) { 43 | forEach(oldStyles, function(val, style) { element.css(style, '');}); 44 | } 45 | if (newStyles) element.css(newStyles); 46 | }, true); 47 | }); 48 | -------------------------------------------------------------------------------- /src/ng/directive/ngTransclude.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ng.directive:ngTransclude 6 | * 7 | * @description 8 | * Insert the transcluded DOM here. 9 | * 10 | * @element ANY 11 | * 12 | * @example 13 | 14 | 15 | 35 |
36 |
37 |
38 | {{text}} 39 |
40 |
41 | 42 | it('should have transcluded', function() { 43 | input('title').enter('TITLE'); 44 | input('text').enter('TEXT'); 45 | expect(binding('title')).toEqual('TITLE'); 46 | expect(binding('text')).toEqual('TEXT'); 47 | }); 48 | 49 |
50 | * 51 | */ 52 | var ngTranscludeDirective = ngDirective({ 53 | controller: ['$transclude', '$element', function($transclude, $element) { 54 | $transclude(function(clone) { 55 | $element.append(clone); 56 | }); 57 | }] 58 | }); 59 | -------------------------------------------------------------------------------- /src/ng/directive/script.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc directive 5 | * @name ng.directive:script 6 | * 7 | * @description 8 | * Load content of a script tag, with type `text/ng-template`, into `$templateCache`, so that the 9 | * template can be used by `ngInclude`, `ngView` or directive templates. 10 | * 11 | * @restrict E 12 | * @param {'text/ng-template'} type must be set to `'text/ng-template'` 13 | * 14 | * @example 15 | 16 | 17 | 20 | 21 | Load inlined template 22 |
23 |
24 | 25 | it('should load template defined inside script tag', function() { 26 | element('#tpl-link').click(); 27 | expect(element('#tpl-content').text()).toMatch(/Content of the template/); 28 | }); 29 | 30 |
31 | */ 32 | var scriptDirective = ['$templateCache', function($templateCache) { 33 | return { 34 | restrict: 'E', 35 | terminal: true, 36 | compile: function(element, attr) { 37 | if (attr.type == 'text/ng-template') { 38 | var templateUrl = attr.id, 39 | // IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent 40 | text = element[0].text; 41 | 42 | $templateCache.put(templateUrl, text); 43 | } 44 | } 45 | }; 46 | }]; 47 | -------------------------------------------------------------------------------- /src/ng/directive/style.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var styleDirective = valueFn({ 4 | restrict: 'E', 5 | terminal: true 6 | }); 7 | -------------------------------------------------------------------------------- /src/ng/document.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc object 5 | * @name ng.$document 6 | * @requires $window 7 | * 8 | * @description 9 | * A {@link angular.element jQuery (lite)}-wrapped reference to the browser's `window.document` 10 | * element. 11 | */ 12 | function $DocumentProvider(){ 13 | this.$get = ['$window', function(window){ 14 | return jqLite(window.document); 15 | }]; 16 | } 17 | -------------------------------------------------------------------------------- /src/ng/exceptionHandler.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc function 5 | * @name ng.$exceptionHandler 6 | * @requires $log 7 | * 8 | * @description 9 | * Any uncaught exception in angular expressions is delegated to this service. 10 | * The default implementation simply delegates to `$log.error` which logs it into 11 | * the browser console. 12 | * 13 | * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by 14 | * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. 15 | * 16 | * @param {Error} exception Exception associated with the error. 17 | * @param {string=} cause optional information about the context in which 18 | * the error was thrown. 19 | * 20 | */ 21 | function $ExceptionHandlerProvider() { 22 | this.$get = ['$log', function($log){ 23 | return function(exception, cause) { 24 | $log.error.apply($log, arguments); 25 | }; 26 | }]; 27 | } 28 | -------------------------------------------------------------------------------- /src/ng/locale.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc object 5 | * @name ng.$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 | function $LocaleProvider(){ 14 | this.$get = function() { 15 | return { 16 | id: 'en-us', 17 | 18 | NUMBER_FORMATS: { 19 | DECIMAL_SEP: '.', 20 | GROUP_SEP: ',', 21 | PATTERNS: [ 22 | { // Decimal Pattern 23 | minInt: 1, 24 | minFrac: 0, 25 | maxFrac: 3, 26 | posPre: '', 27 | posSuf: '', 28 | negPre: '-', 29 | negSuf: '', 30 | gSize: 3, 31 | lgSize: 3 32 | },{ //Currency Pattern 33 | minInt: 1, 34 | minFrac: 2, 35 | maxFrac: 2, 36 | posPre: '\u00A4', 37 | posSuf: '', 38 | negPre: '(\u00A4', 39 | negSuf: ')', 40 | gSize: 3, 41 | lgSize: 3 42 | } 43 | ], 44 | CURRENCY_SYM: '$' 45 | }, 46 | 47 | DATETIME_FORMATS: { 48 | MONTH: 'January,February,March,April,May,June,July,August,September,October,November,December' 49 | .split(','), 50 | SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','), 51 | DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','), 52 | SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','), 53 | AMPMS: ['AM','PM'], 54 | medium: 'MMM d, y h:mm:ss a', 55 | short: 'M/d/yy h:mm a', 56 | fullDate: 'EEEE, MMMM d, y', 57 | longDate: 'MMMM d, y', 58 | mediumDate: 'MMM d, y', 59 | shortDate: 'M/d/yy', 60 | mediumTime: 'h:mm:ss a', 61 | shortTime: 'h:mm a' 62 | }, 63 | 64 | pluralCat: function(num) { 65 | if (num === 1) { 66 | return 'one'; 67 | } 68 | return 'other'; 69 | } 70 | }; 71 | }; 72 | } 73 | -------------------------------------------------------------------------------- /src/ng/rootElement.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc overview 5 | * @name ng.$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 represent the root element of application. It is also the 11 | * location where the applications {@link AUTO.$injector $injector} service gets 12 | * published, it can be retrieved using `$rootElement.injector()`. 13 | */ 14 | 15 | 16 | // the implementation is in angular.bootstrap 17 | -------------------------------------------------------------------------------- /src/ng/routeParams.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc object 5 | * @name ng.$routeParams 6 | * @requires $route 7 | * 8 | * @description 9 | * Current set of route parameters. The route parameters are a combination of the 10 | * {@link ng.$location $location} `search()`, and `path()`. The `path` parameters 11 | * are extracted when the {@link ng.$route $route} path is matched. 12 | * 13 | * In case of parameter name collision, `path` params take precedence over `search` params. 14 | * 15 | * The service guarantees that the identity of the `$routeParams` object will remain unchanged 16 | * (but its properties will likely change) even when a route change occurs. 17 | * 18 | * @example 19 | *
20 |  *  // Given:
21 |  *  // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
22 |  *  // Route: /Chapter/:chapterId/Section/:sectionId
23 |  *  //
24 |  *  // Then
25 |  *  $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
26 |  * 
27 | */ 28 | function $RouteParamsProvider() { 29 | this.$get = valueFn({}); 30 | } 31 | -------------------------------------------------------------------------------- /src/ng/sniffer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * !!! This is an undocumented "private" service !!! 5 | * 6 | * @name ng.$sniffer 7 | * @requires $window 8 | * @requires $document 9 | * 10 | * @property {boolean} history Does the browser support html5 history api ? 11 | * @property {boolean} hashchange Does the browser support hashchange event ? 12 | * 13 | * @description 14 | * This is very simple implementation of testing browser's features. 15 | */ 16 | function $SnifferProvider() { 17 | this.$get = ['$window', '$document', function($window, $document) { 18 | var eventSupport = {}, 19 | android = int((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]), 20 | document = $document[0]; 21 | 22 | return { 23 | // Android has history.pushState, but it does not update location correctly 24 | // so let's not use the history API at all. 25 | // http://code.google.com/p/android/issues/detail?id=17471 26 | // https://github.com/angular/angular.js/issues/904 27 | history: !!($window.history && $window.history.pushState && !(android < 4)), 28 | hashchange: 'onhashchange' in $window && 29 | // IE8 compatible mode lies 30 | (!document.documentMode || document.documentMode > 7), 31 | hasEvent: function(event) { 32 | // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have 33 | // it. In particular the event is not fired when backspace or delete key are pressed or 34 | // when cut operation is performed. 35 | if (event == 'input' && msie == 9) return false; 36 | 37 | if (isUndefined(eventSupport[event])) { 38 | var divElm = document.createElement('div'); 39 | eventSupport[event] = 'on' + event in divElm; 40 | } 41 | 42 | return eventSupport[event]; 43 | }, 44 | csp: document.securityPolicy ? document.securityPolicy.isActive : false 45 | }; 46 | }]; 47 | } 48 | -------------------------------------------------------------------------------- /src/ng/window.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc object 5 | * @name ng.$window 6 | * 7 | * @description 8 | * A reference to the browser's `window` object. While `window` 9 | * is globally available in JavaScript, it causes testability problems, because 10 | * it is a global variable. In angular we always refer to it through the 11 | * `$window` service, so it may be overriden, removed or mocked for testing. 12 | * 13 | * All expressions are evaluated with respect to current scope so they don't 14 | * suffer from window globality. 15 | * 16 | * @example 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | */ 26 | function $WindowProvider(){ 27 | this.$get = valueFn(window); 28 | } 29 | -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_chr.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["ᎤᏃᎸᏔᏅ","ᎧᎦᎵ","ᎠᏅᏱ","ᎧᏬᏂ","ᎠᏂᏍᎬᏘ","ᏕᎭᎷᏱ","ᎫᏰᏉᏂ","ᎦᎶᏂ","ᏚᎵᏍᏗ","ᏚᏂᏅᏗ","ᏅᏓᏕᏆ","ᎤᏍᎩᏱ"],"SHORTMONTH":["ᎤᏃ","ᎧᎦ","ᎠᏅ","ᎧᏬ","ᎠᏂ","ᏕᎭ","ᎫᏰ","ᎦᎶ","ᏚᎵ","ᏚᏂ","ᏅᏓ","ᎤᏍ"],"DAY":["ᎤᎾᏙᏓᏆᏍᎬ","ᎤᎾᏙᏓᏉᏅᎯ","ᏔᎵᏁᎢᎦ","ᏦᎢᏁᎢᎦ","ᏅᎩᏁᎢᎦ","ᏧᎾᎩᎶᏍᏗ","ᎤᎾᏙᏓᏈᏕᎾ"],"SHORTDAY":["ᏆᏍᎬ","ᏉᏅᎯ","ᏔᎵᏁ","ᏦᎢᏁ","ᏅᎩᏁ","ᏧᎾᎩ","ᏈᏕᎾ"],"AMPMS":["ᏌᎾᎴ","ᏒᎯᏱᎢᏗᏢ"],"medium":"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a","fullDate":"EEEE, MMMM d, y","longDate":"MMMM d, y","mediumDate":"MMM d, y","shortDate":"M/d/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"id":"chr"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_cy.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffenaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"],"SHORTMONTH":["Ion","Chwef","Mawrth","Ebrill","Mai","Meh","Gorff","Awst","Medi","Hyd","Tach","Rhag"],"DAY":["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher","Dydd Iau","Dydd Gwener","Dydd Sadwrn"],"SHORTDAY":["Sul","Llun","Maw","Mer","Iau","Gwen","Sad"],"AMPMS":["AM","PM"],"medium":"d MMM y HH:mm:ss","short":"dd/MM/yyyy HH:mm","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"dd/MM/yyyy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"id":"cy"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_el-polyton.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":",","GROUP_SEP":".","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"","posSuf":" \u00A4","negPre":"-","negSuf":" \u00A4","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"€"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],"SHORTMONTH":["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],"DAY":["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],"SHORTDAY":["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],"AMPMS":["π.μ.","μ.μ."],"medium":"d MMM y h:mm:ss a","short":"d/M/yy h:mm a","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"d/M/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"id":"el-polyton"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_en-zz.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"\u00A4","posSuf":"","negPre":"(\u00A4","negSuf":")","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"$"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["January","February","March","April","May","June","July","August","September","October","November","December"],"SHORTMONTH":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"DAY":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"SHORTDAY":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"AMPMS":["AM","PM"],"medium":"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a","fullDate":"EEEE, MMMM d, y","longDate":"MMMM d, y","mediumDate":"MMM d, y","shortDate":"M/d/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"id":"en-zz"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_haw.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["Ianuali","Pepeluali","Malaki","ʻApelila","Mei","Iune","Iulai","ʻAukake","Kepakemapa","ʻOkakopa","Nowemapa","Kekemapa"],"SHORTMONTH":["Ian.","Pep.","Mal.","ʻAp.","Mei","Iun.","Iul.","ʻAu.","Kep.","ʻOk.","Now.","Kek."],"DAY":["Lāpule","Poʻakahi","Poʻalua","Poʻakolu","Poʻahā","Poʻalima","Poʻaono"],"SHORTDAY":["LP","P1","P2","P3","P4","P5","P6"],"AMPMS":["AM","PM"],"medium":"d MMM y h:mm:ss a","short":"d/M/yy h:mm a","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"d MMM y","shortDate":"d/M/yy","mediumTime":"h:mm:ss a","shortTime":"h:mm a"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"id":"haw"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_ja-jp.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", { 4 | "DATETIME_FORMATS": { 5 | "AMPMS": { 6 | "0": "午前", 7 | "1": "午後" 8 | }, 9 | "DAY": { 10 | "0": "日曜日", 11 | "1": "月曜日", 12 | "2": "火曜日", 13 | "3": "水曜日", 14 | "4": "木曜日", 15 | "5": "金曜日", 16 | "6": "土曜日" 17 | }, 18 | "MONTH": { 19 | "0": "1月", 20 | "1": "2月", 21 | "2": "3月", 22 | "3": "4月", 23 | "4": "5月", 24 | "5": "6月", 25 | "6": "7月", 26 | "7": "8月", 27 | "8": "9月", 28 | "9": "10月", 29 | "10": "11月", 30 | "11": "12月" 31 | }, 32 | "SHORTDAY": { 33 | "0": "日", 34 | "1": "月", 35 | "2": "火", 36 | "3": "水", 37 | "4": "木", 38 | "5": "金", 39 | "6": "土" 40 | }, 41 | "SHORTMONTH": { 42 | "0": "1月", 43 | "1": "2月", 44 | "2": "3月", 45 | "3": "4月", 46 | "4": "5月", 47 | "5": "6月", 48 | "6": "7月", 49 | "7": "8月", 50 | "8": "9月", 51 | "9": "10月", 52 | "10": "11月", 53 | "11": "12月" 54 | }, 55 | "fullDate": "y年M月d日EEEE", 56 | "longDate": "y年M月d日", 57 | "medium": "yyyy/MM/dd H:mm:ss", 58 | "mediumDate": "yyyy/MM/dd", 59 | "mediumTime": "H:mm:ss", 60 | "short": "yyyy/MM/dd H:mm", 61 | "shortDate": "yyyy/MM/dd", 62 | "shortTime": "H:mm" 63 | }, 64 | "NUMBER_FORMATS": { 65 | "CURRENCY_SYM": "¥", 66 | "DECIMAL_SEP": ".", 67 | "GROUP_SEP": ",", 68 | "PATTERNS": { 69 | "0": { 70 | "gSize": 3, 71 | "lgSize": 3, 72 | "macFrac": 0, 73 | "maxFrac": 3, 74 | "minFrac": 0, 75 | "minInt": 1, 76 | "negPre": "-", 77 | "negSuf": "", 78 | "posPre": "", 79 | "posSuf": "" 80 | }, 81 | "1": { 82 | "gSize": 3, 83 | "lgSize": 3, 84 | "macFrac": 0, 85 | "maxFrac": 2, 86 | "minFrac": 2, 87 | "minInt": 1, 88 | "negPre": "\u00A4-", 89 | "negSuf": "", 90 | "posPre": "\u00A4", 91 | "posSuf": "" 92 | } 93 | } 94 | }, 95 | "id": "ja-jp", 96 | "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;} 97 | }); 98 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_ja.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", { 4 | "DATETIME_FORMATS": { 5 | "AMPMS": { 6 | "0": "午前", 7 | "1": "午後" 8 | }, 9 | "DAY": { 10 | "0": "日曜日", 11 | "1": "月曜日", 12 | "2": "火曜日", 13 | "3": "水曜日", 14 | "4": "木曜日", 15 | "5": "金曜日", 16 | "6": "土曜日" 17 | }, 18 | "MONTH": { 19 | "0": "1月", 20 | "1": "2月", 21 | "2": "3月", 22 | "3": "4月", 23 | "4": "5月", 24 | "5": "6月", 25 | "6": "7月", 26 | "7": "8月", 27 | "8": "9月", 28 | "9": "10月", 29 | "10": "11月", 30 | "11": "12月" 31 | }, 32 | "SHORTDAY": { 33 | "0": "日", 34 | "1": "月", 35 | "2": "火", 36 | "3": "水", 37 | "4": "木", 38 | "5": "金", 39 | "6": "土" 40 | }, 41 | "SHORTMONTH": { 42 | "0": "1月", 43 | "1": "2月", 44 | "2": "3月", 45 | "3": "4月", 46 | "4": "5月", 47 | "5": "6月", 48 | "6": "7月", 49 | "7": "8月", 50 | "8": "9月", 51 | "9": "10月", 52 | "10": "11月", 53 | "11": "12月" 54 | }, 55 | "fullDate": "y年M月d日EEEE", 56 | "longDate": "y年M月d日", 57 | "medium": "yyyy/MM/dd H:mm:ss", 58 | "mediumDate": "yyyy/MM/dd", 59 | "mediumTime": "H:mm:ss", 60 | "short": "yyyy/MM/dd H:mm", 61 | "shortDate": "yyyy/MM/dd", 62 | "shortTime": "H:mm" 63 | }, 64 | "NUMBER_FORMATS": { 65 | "CURRENCY_SYM": "¥", 66 | "DECIMAL_SEP": ".", 67 | "GROUP_SEP": ",", 68 | "PATTERNS": { 69 | "0": { 70 | "gSize": 3, 71 | "lgSize": 3, 72 | "macFrac": 0, 73 | "maxFrac": 3, 74 | "minFrac": 0, 75 | "minInt": 1, 76 | "negPre": "-", 77 | "negSuf": "", 78 | "posPre": "", 79 | "posSuf": "" 80 | }, 81 | "1": { 82 | "gSize": 3, 83 | "lgSize": 3, 84 | "macFrac": 0, 85 | "maxFrac": 2, 86 | "minFrac": 2, 87 | "minInt": 1, 88 | "negPre": "\u00A4-", 89 | "negSuf": "", 90 | "posPre": "\u00A4", 91 | "posSuf": "" 92 | } 93 | } 94 | }, 95 | "id": "ja", 96 | "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;} 97 | }); 98 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_mo.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],"SHORTMONTH":["ian.","feb.","mar.","apr.","mai","iun.","iul.","aug.","sept.","oct.","nov.","dec."],"DAY":["duminică","luni","marți","miercuri","joi","vineri","sâmbătă"],"SHORTDAY":["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],"AMPMS":["AM","PM"],"medium":"dd.MM.yyyy HH:mm:ss","short":"dd.MM.yyyy HH:mm","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"dd.MM.yyyy","shortDate":"dd.MM.yyyy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"NUMBER_FORMATS":{"DECIMAL_SEP":",","GROUP_SEP":".","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"","posSuf":" \u00A4","negPre":"-","negSuf":" \u00A4","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"MDL"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 0 || n != 1 && (n % 100) >= 1 && (n % 100) <= 19 && n == Math.floor(n)) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;},"id":"mo"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_sr-rs.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"","posSuf":" \u00A4","negPre":"-","negSuf":" \u00A4","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"РСД"},"pluralCat":function (n) { if ((n % 10) == 1 && (n % 100) != 11) { return PLURAL_CATEGORY.ONE; } if ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { return PLURAL_CATEGORY.FEW; } if ((n % 10) == 0 || ((n % 10) >= 5 && (n % 10) <= 9) || ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],"SHORTMONTH":["јан","феб","мар","апр","мај","јун","јул","авг","сеп","окт","нов","дец"],"DAY":["недеља","понедељак","уторак","среда","четвртак","петак","субота"],"SHORTDAY":["нед","пон","уто","сре","чет","пет","суб"],"AMPMS":["пре подне","поподне"],"medium":"dd.MM.y. HH.mm.ss","short":"d.M.yy. HH.mm","fullDate":"EEEE, dd. MMMM y.","longDate":"dd. MMMM y.","mediumDate":"dd.MM.y.","shortDate":"d.M.yy.","mediumTime":"HH.mm.ss","shortTime":"HH.mm"},"id":"sr-rs"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_tl-ph.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"\u00A4 ","posSuf":"","negPre":"\u00A4 -","negSuf":"","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"P"},"pluralCat":function (n) { if (n == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["Enero","Pebrero","Marso","Abril","Mayo","Hunyo","Hulyo","Agosto","Setyembre","Oktubre","Nobyembre","Disyembre"],"SHORTMONTH":["Ene","Peb","Mar","Abr","May","Hun","Hul","Ago","Set","Okt","Nob","Dis"],"DAY":["Linggo","Lunes","Martes","Miyerkules","Huwebes","Biyernes","Sabado"],"SHORTDAY":["Lin","Lun","Mar","Mye","Huw","Bye","Sab"],"AMPMS":["AM","PM"],"medium":"MMM d, y HH:mm:ss","short":"M/d/yy HH:mm","fullDate":"EEEE, MMMM dd y","longDate":"MMMM d, y","mediumDate":"MMM d, y","shortDate":"M/d/yy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"id":"tl-ph"}); 4 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_zh-cn.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", { 4 | "DATETIME_FORMATS": { 5 | "AMPMS": { 6 | "0": "上午", 7 | "1": "下午" 8 | }, 9 | "DAY": { 10 | "0": "星期日", 11 | "1": "星期一", 12 | "2": "星期二", 13 | "3": "星期三", 14 | "4": "星期四", 15 | "5": "星期五", 16 | "6": "星期六" 17 | }, 18 | "MONTH": { 19 | "0": "1月", 20 | "1": "2月", 21 | "2": "3月", 22 | "3": "4月", 23 | "4": "5月", 24 | "5": "6月", 25 | "6": "7月", 26 | "7": "8月", 27 | "8": "9月", 28 | "9": "10月", 29 | "10": "11月", 30 | "11": "12月" 31 | }, 32 | "SHORTDAY": { 33 | "0": "周日", 34 | "1": "周一", 35 | "2": "周二", 36 | "3": "周三", 37 | "4": "周四", 38 | "5": "周五", 39 | "6": "周六" 40 | }, 41 | "SHORTMONTH": { 42 | "0": "1月", 43 | "1": "2月", 44 | "2": "3月", 45 | "3": "4月", 46 | "4": "5月", 47 | "5": "6月", 48 | "6": "7月", 49 | "7": "8月", 50 | "8": "9月", 51 | "9": "10月", 52 | "10": "11月", 53 | "11": "12月" 54 | }, 55 | "fullDate": "y年M月d日EEEE", 56 | "longDate": "y年M月d日", 57 | "medium": "yyyy-M-d ah:mm:ss", 58 | "mediumDate": "yyyy-M-d", 59 | "mediumTime": "ah:mm:ss", 60 | "short": "yy-M-d ah:mm", 61 | "shortDate": "yy-M-d", 62 | "shortTime": "ah:mm" 63 | }, 64 | "NUMBER_FORMATS": { 65 | "CURRENCY_SYM": "¥", 66 | "DECIMAL_SEP": ".", 67 | "GROUP_SEP": ",", 68 | "PATTERNS": { 69 | "0": { 70 | "gSize": 3, 71 | "lgSize": 3, 72 | "macFrac": 0, 73 | "maxFrac": 3, 74 | "minFrac": 0, 75 | "minInt": 1, 76 | "negPre": "-", 77 | "negSuf": "", 78 | "posPre": "", 79 | "posSuf": "" 80 | }, 81 | "1": { 82 | "gSize": 3, 83 | "lgSize": 3, 84 | "macFrac": 0, 85 | "maxFrac": 2, 86 | "minFrac": 2, 87 | "minInt": 1, 88 | "negPre": "(\u00A4", 89 | "negSuf": ")", 90 | "posPre": "\u00A4", 91 | "posSuf": "" 92 | } 93 | } 94 | }, 95 | "id": "zh-cn", 96 | "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;} 97 | }); 98 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_zh-hant.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", { 4 | "DATETIME_FORMATS": { 5 | "AMPMS": { 6 | "0": "上午", 7 | "1": "下午" 8 | }, 9 | "DAY": { 10 | "0": "星期日", 11 | "1": "星期一", 12 | "2": "星期二", 13 | "3": "星期三", 14 | "4": "星期四", 15 | "5": "星期五", 16 | "6": "星期六" 17 | }, 18 | "MONTH": { 19 | "0": "1月", 20 | "1": "2月", 21 | "2": "3月", 22 | "3": "4月", 23 | "4": "5月", 24 | "5": "6月", 25 | "6": "7月", 26 | "7": "8月", 27 | "8": "9月", 28 | "9": "10月", 29 | "10": "11月", 30 | "11": "12月" 31 | }, 32 | "SHORTDAY": { 33 | "0": "週日", 34 | "1": "週一", 35 | "2": "週二", 36 | "3": "週三", 37 | "4": "週四", 38 | "5": "週五", 39 | "6": "週六" 40 | }, 41 | "SHORTMONTH": { 42 | "0": "1月", 43 | "1": "2月", 44 | "2": "3月", 45 | "3": "4月", 46 | "4": "5月", 47 | "5": "6月", 48 | "6": "7月", 49 | "7": "8月", 50 | "8": "9月", 51 | "9": "10月", 52 | "10": "11月", 53 | "11": "12月" 54 | }, 55 | "fullDate": "y年M月d日EEEE", 56 | "longDate": "y年M月d日", 57 | "medium": "yyyy/M/d ah:mm:ss", 58 | "mediumDate": "yyyy/M/d", 59 | "mediumTime": "ah:mm:ss", 60 | "short": "y/M/d ah:mm", 61 | "shortDate": "y/M/d", 62 | "shortTime": "ah:mm" 63 | }, 64 | "NUMBER_FORMATS": { 65 | "CURRENCY_SYM": "¥", 66 | "DECIMAL_SEP": ".", 67 | "GROUP_SEP": ",", 68 | "PATTERNS": { 69 | "0": { 70 | "gSize": 3, 71 | "lgSize": 3, 72 | "macFrac": 0, 73 | "maxFrac": 3, 74 | "minFrac": 0, 75 | "minInt": 1, 76 | "negPre": "-", 77 | "negSuf": "", 78 | "posPre": "", 79 | "posSuf": "" 80 | }, 81 | "1": { 82 | "gSize": 3, 83 | "lgSize": 3, 84 | "macFrac": 0, 85 | "maxFrac": 2, 86 | "minFrac": 2, 87 | "minInt": 1, 88 | "negPre": "(\u00A4", 89 | "negSuf": ")", 90 | "posPre": "\u00A4", 91 | "posSuf": "" 92 | } 93 | } 94 | }, 95 | "id": "zh-hant", 96 | "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;} 97 | }); 98 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_zh-hk.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", { 4 | "DATETIME_FORMATS": { 5 | "AMPMS": { 6 | "0": "上午", 7 | "1": "下午" 8 | }, 9 | "DAY": { 10 | "0": "星期日", 11 | "1": "星期一", 12 | "2": "星期二", 13 | "3": "星期三", 14 | "4": "星期四", 15 | "5": "星期五", 16 | "6": "星期六" 17 | }, 18 | "MONTH": { 19 | "0": "1月", 20 | "1": "2月", 21 | "2": "3月", 22 | "3": "4月", 23 | "4": "5月", 24 | "5": "6月", 25 | "6": "7月", 26 | "7": "8月", 27 | "8": "9月", 28 | "9": "10月", 29 | "10": "11月", 30 | "11": "12月" 31 | }, 32 | "SHORTDAY": { 33 | "0": "週日", 34 | "1": "週一", 35 | "2": "週二", 36 | "3": "週三", 37 | "4": "週四", 38 | "5": "週五", 39 | "6": "週六" 40 | }, 41 | "SHORTMONTH": { 42 | "0": "1月", 43 | "1": "2月", 44 | "2": "3月", 45 | "3": "4月", 46 | "4": "5月", 47 | "5": "6月", 48 | "6": "7月", 49 | "7": "8月", 50 | "8": "9月", 51 | "9": "10月", 52 | "10": "11月", 53 | "11": "12月" 54 | }, 55 | "fullDate": "y年M月d日EEEE", 56 | "longDate": "y年M月d日", 57 | "medium": "y年M月d日 ahh:mm:ss", 58 | "mediumDate": "y年M月d日", 59 | "mediumTime": "ahh:mm:ss", 60 | "short": "yy年M月d日 ah:mm", 61 | "shortDate": "yy年M月d日", 62 | "shortTime": "ah:mm" 63 | }, 64 | "NUMBER_FORMATS": { 65 | "CURRENCY_SYM": "$", 66 | "DECIMAL_SEP": ".", 67 | "GROUP_SEP": ",", 68 | "PATTERNS": { 69 | "0": { 70 | "gSize": 3, 71 | "lgSize": 3, 72 | "macFrac": 0, 73 | "maxFrac": 3, 74 | "minFrac": 0, 75 | "minInt": 1, 76 | "negPre": "-", 77 | "negSuf": "", 78 | "posPre": "", 79 | "posSuf": "" 80 | }, 81 | "1": { 82 | "gSize": 3, 83 | "lgSize": 3, 84 | "macFrac": 0, 85 | "maxFrac": 2, 86 | "minFrac": 2, 87 | "minInt": 1, 88 | "negPre": "(\u00A4", 89 | "negSuf": ")", 90 | "posPre": "\u00A4", 91 | "posSuf": "" 92 | } 93 | } 94 | }, 95 | "id": "zh-hk", 96 | "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;} 97 | }); 98 | }]); -------------------------------------------------------------------------------- /src/ngLocale/angular-locale_zh.js: -------------------------------------------------------------------------------- 1 | angular.module("ngLocale", [], ["$provide", function($provide) { 2 | var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; 3 | $provide.value("$locale", { 4 | "DATETIME_FORMATS": { 5 | "AMPMS": { 6 | "0": "上午", 7 | "1": "下午" 8 | }, 9 | "DAY": { 10 | "0": "星期日", 11 | "1": "星期一", 12 | "2": "星期二", 13 | "3": "星期三", 14 | "4": "星期四", 15 | "5": "星期五", 16 | "6": "星期六" 17 | }, 18 | "MONTH": { 19 | "0": "1月", 20 | "1": "2月", 21 | "2": "3月", 22 | "3": "4月", 23 | "4": "5月", 24 | "5": "6月", 25 | "6": "7月", 26 | "7": "8月", 27 | "8": "9月", 28 | "9": "10月", 29 | "10": "11月", 30 | "11": "12月" 31 | }, 32 | "SHORTDAY": { 33 | "0": "周日", 34 | "1": "周一", 35 | "2": "周二", 36 | "3": "周三", 37 | "4": "周四", 38 | "5": "周五", 39 | "6": "周六" 40 | }, 41 | "SHORTMONTH": { 42 | "0": "1月", 43 | "1": "2月", 44 | "2": "3月", 45 | "3": "4月", 46 | "4": "5月", 47 | "5": "6月", 48 | "6": "7月", 49 | "7": "8月", 50 | "8": "9月", 51 | "9": "10月", 52 | "10": "11月", 53 | "11": "12月" 54 | }, 55 | "fullDate": "y年M月d日EEEE", 56 | "longDate": "y年M月d日", 57 | "medium": "yyyy-M-d ah:mm:ss", 58 | "mediumDate": "yyyy-M-d", 59 | "mediumTime": "ah:mm:ss", 60 | "short": "yy-M-d ah:mm", 61 | "shortDate": "yy-M-d", 62 | "shortTime": "ah:mm" 63 | }, 64 | "NUMBER_FORMATS": { 65 | "CURRENCY_SYM": "¥", 66 | "DECIMAL_SEP": ".", 67 | "GROUP_SEP": ",", 68 | "PATTERNS": { 69 | "0": { 70 | "gSize": 3, 71 | "lgSize": 3, 72 | "macFrac": 0, 73 | "maxFrac": 3, 74 | "minFrac": 0, 75 | "minInt": 1, 76 | "negPre": "-", 77 | "negSuf": "", 78 | "posPre": "", 79 | "posSuf": "" 80 | }, 81 | "1": { 82 | "gSize": 3, 83 | "lgSize": 3, 84 | "macFrac": 0, 85 | "maxFrac": 2, 86 | "minFrac": 2, 87 | "minInt": 1, 88 | "negPre": "(\u00A4", 89 | "negSuf": ")", 90 | "posPre": "\u00A4", 91 | "posSuf": "" 92 | } 93 | } 94 | }, 95 | "id": "zh", 96 | "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;} 97 | }); 98 | }]); -------------------------------------------------------------------------------- /src/ngMobile/mobile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * @ngdoc overview 5 | * @name ngMobile 6 | * @description 7 | */ 8 | 9 | /* 10 | * Touch events and other mobile helpers by Braden Shepherdson (braden.shepherdson@gmail.com) 11 | * Based on jQuery Mobile touch event handling (jquerymobile.com) 12 | */ 13 | 14 | // define ngSanitize module and register $sanitize service 15 | var ngMobile = angular.module('ngMobile', []); 16 | 17 | -------------------------------------------------------------------------------- /src/ngSanitize/directive/ngBindHtml.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | /** 5 | * @ngdoc directive 6 | * @name ngSanitize.directive:ngBindHtml 7 | * 8 | * @description 9 | * Creates a binding that will sanitize the result of evaluating the `expression` with the 10 | * {@link ngSanitize.$sanitize $sanitize} service and innerHTML the result into the current element. 11 | * 12 | * See {@link ngSanitize.$sanitize $sanitize} docs for examples. 13 | * 14 | * @element ANY 15 | * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate. 16 | */ 17 | angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($sanitize) { 18 | return function(scope, element, attr) { 19 | element.addClass('ng-binding').data('$binding', attr.ngBindHtml); 20 | scope.$watch(attr.ngBindHtml, function ngBindHtmlWatchAction(value) { 21 | value = $sanitize(value); 22 | element.html(value || ''); 23 | }); 24 | }; 25 | }]); 26 | -------------------------------------------------------------------------------- /src/ngScenario/Future.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * A future action in a spec. 5 | * 6 | * @param {string} name of the future action 7 | * @param {function()} future callback(error, result) 8 | * @param {function()} Optional. function that returns the file/line number. 9 | */ 10 | angular.scenario.Future = function(name, behavior, line) { 11 | this.name = name; 12 | this.behavior = behavior; 13 | this.fulfilled = false; 14 | this.value = undefined; 15 | this.parser = angular.identity; 16 | this.line = line || function() { return ''; }; 17 | }; 18 | 19 | /** 20 | * Executes the behavior of the closure. 21 | * 22 | * @param {function()} doneFn Callback function(error, result) 23 | */ 24 | angular.scenario.Future.prototype.execute = function(doneFn) { 25 | var self = this; 26 | this.behavior(function(error, result) { 27 | self.fulfilled = true; 28 | if (result) { 29 | try { 30 | result = self.parser(result); 31 | } catch(e) { 32 | error = e; 33 | } 34 | } 35 | self.value = error || result; 36 | doneFn(error, result); 37 | }); 38 | }; 39 | 40 | /** 41 | * Configures the future to convert it's final with a function fn(value) 42 | * 43 | * @param {function()} fn function(value) that returns the parsed value 44 | */ 45 | angular.scenario.Future.prototype.parsedWith = function(fn) { 46 | this.parser = fn; 47 | return this; 48 | }; 49 | 50 | /** 51 | * Configures the future to parse it's final value from JSON 52 | * into objects. 53 | */ 54 | angular.scenario.Future.prototype.fromJson = function() { 55 | return this.parsedWith(angular.fromJson); 56 | }; 57 | 58 | /** 59 | * Configures the future to convert it's final value from objects 60 | * into JSON. 61 | */ 62 | angular.scenario.Future.prototype.toJson = function() { 63 | return this.parsedWith(angular.toJson); 64 | }; 65 | -------------------------------------------------------------------------------- /src/ngScenario/angular-bootstrap.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | (function(previousOnLoad){ 4 | var prefix = (function() { 5 | var filename = /(.*\/)angular-bootstrap.js(#(.*))?/; 6 | var scripts = document.getElementsByTagName("script"); 7 | for(var j = 0; j < scripts.length; j++) { 8 | var src = scripts[j].src; 9 | if (src && src.match(filename)) { 10 | var parts = src.match(filename); 11 | return parts[1]; 12 | } 13 | } 14 | })(); 15 | 16 | function addScript(path) { 17 | document.write(''); 18 | } 19 | 20 | function addCSS(path) { 21 | document.write(''); 22 | } 23 | 24 | window.onload = function() { 25 | try { 26 | if (previousOnLoad) previousOnLoad(); 27 | } catch(e) {} 28 | angular.scenario.setUpAndRun({}); 29 | }; 30 | 31 | addCSS("../../css/angular-scenario.css"); 32 | addScript("../../lib/jquery/jquery.js"); 33 | document.write( 34 | '' 37 | ); 38 | addScript("../angular-bootstrap.js"); 39 | 40 | addScript("Scenario.js"); 41 | addScript("Application.js"); 42 | addScript("Describe.js"); 43 | addScript("Future.js"); 44 | addScript("Runner.js"); 45 | addScript("SpecRunner.js"); 46 | addScript("dsl.js"); 47 | addScript("matchers.js"); 48 | addScript("ObjectModel.js"); 49 | addScript("output/Html.js"); 50 | addScript("output/Json.js"); 51 | addScript("output/Object.js"); 52 | addScript("output/Xml.js"); 53 | 54 | // Create the runner (which also sets up the global API) 55 | document.write( 56 | ''); 59 | 60 | })(window.onload); 61 | -------------------------------------------------------------------------------- /src/ngScenario/angular.prefix: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v"NG_VERSION_FULL" 3 | * (c) 2010-2012 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window, document){ 7 | var _jQuery = window.jQuery.noConflict(true); 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/ngScenario/output/Xml.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Generates XML output into a context. 5 | */ 6 | angular.scenario.output('xml', function(context, runner, model) { 7 | var $ = function(args) {return new context.init(args);}; 8 | model.on('RunnerEnd', function() { 9 | var scenario = $(''); 10 | context.append(scenario); 11 | serializeXml(scenario, model.value); 12 | }); 13 | 14 | /** 15 | * Convert the tree into XML. 16 | * 17 | * @param {Object} context jQuery context to add the XML to. 18 | * @param {Object} tree node to serialize 19 | */ 20 | function serializeXml(context, tree) { 21 | angular.forEach(tree.children, function(child) { 22 | var describeContext = $(''); 23 | describeContext.attr('id', child.id); 24 | describeContext.attr('name', child.name); 25 | context.append(describeContext); 26 | serializeXml(describeContext, child); 27 | }); 28 | var its = $(''); 29 | context.append(its); 30 | angular.forEach(tree.specs, function(spec) { 31 | var it = $(''); 32 | it.attr('id', spec.id); 33 | it.attr('name', spec.name); 34 | it.attr('duration', spec.duration); 35 | it.attr('status', spec.status); 36 | its.append(it); 37 | angular.forEach(spec.steps, function(step) { 38 | var stepContext = $(''); 39 | stepContext.attr('name', step.name); 40 | stepContext.attr('duration', step.duration); 41 | stepContext.attr('status', step.status); 42 | it.append(stepContext); 43 | if (step.error) { 44 | var error = $(''); 45 | stepContext.append(error); 46 | error.text(formatException(step.error)); 47 | } 48 | }); 49 | }); 50 | } 51 | }); 52 | -------------------------------------------------------------------------------- /src/publishExternalApis.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | publishExternalAPI(angular); 4 | -------------------------------------------------------------------------------- /start-iteration.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ./version.js --minor-bump 4 | VERSION=`./version.js --curent` 5 | git commit -a -m "chore(relase): start v$VERSION iteration" 6 | -------------------------------------------------------------------------------- /test/ApiSpecs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('api', function() { 4 | 5 | describe('HashMap', function() { 6 | it('should do basic crud', function() { 7 | var map = new HashMap(); 8 | var key = {}; 9 | var value1 = {}; 10 | var value2 = {}; 11 | map.put(key, value1); 12 | map.put(key, value2); 13 | expect(map.get(key)).toBe(value2); 14 | expect(map.get({})).toBe(undefined); 15 | expect(map.remove(key)).toBe(value2); 16 | expect(map.get(key)).toBe(undefined); 17 | }); 18 | 19 | it('should init from an array', function() { 20 | var map = new HashMap(['a','b']); 21 | expect(map.get('a')).toBe(0); 22 | expect(map.get('b')).toBe(1); 23 | expect(map.get('c')).toBe(undefined); 24 | }); 25 | }); 26 | 27 | 28 | describe('HashQueueMap', function() { 29 | it('should do basic crud with collections', function() { 30 | var map = new HashQueueMap(); 31 | map.push('key', 'a'); 32 | map.push('key', 'b'); 33 | expect(map[hashKey('key')]).toEqual(['a', 'b']); 34 | expect(map.peek('key')).toEqual('a'); 35 | expect(map[hashKey('key')]).toEqual(['a', 'b']); 36 | expect(map.shift('key')).toEqual('a'); 37 | expect(map.peek('key')).toEqual('b'); 38 | expect(map[hashKey('key')]).toEqual(['b']); 39 | expect(map.shift('key')).toEqual('b'); 40 | expect(map.shift('key')).toEqual(undefined); 41 | expect(map[hashKey('key')]).toEqual(undefined); 42 | }); 43 | 44 | it('should support primitive and object keys', function() { 45 | var obj1 = {}, 46 | obj2 = {}; 47 | 48 | var map = new HashQueueMap(); 49 | map.push(obj1, 'a1'); 50 | map.push(obj1, 'a2'); 51 | map.push(obj2, 'b'); 52 | map.push(1, 'c'); 53 | map.push(undefined, 'd'); 54 | map.push(null, 'e'); 55 | 56 | expect(map[hashKey(obj1)]).toEqual(['a1', 'a2']); 57 | expect(map[hashKey(obj2)]).toEqual(['b']); 58 | expect(map[hashKey(1)]).toEqual(['c']); 59 | expect(map[hashKey(undefined)]).toEqual(['d']); 60 | expect(map[hashKey(null)]).toEqual(['e']); 61 | }); 62 | }); 63 | }); 64 | 65 | -------------------------------------------------------------------------------- /test/jQueryPatchSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | if (window.jQuery) { 4 | 5 | describe('jQuery patch', function() { 6 | 7 | var doc = null; 8 | var divSpy = null; 9 | var spy1 = null; 10 | var spy2 = null; 11 | 12 | beforeEach(function() { 13 | divSpy = jasmine.createSpy('div.$destroy'); 14 | spy1 = jasmine.createSpy('span1.$destroy'); 15 | spy2 = jasmine.createSpy('span2.$destroy'); 16 | doc = $('
abcxyz
'); 17 | doc.find('span.first').bind('$destroy', spy1); 18 | doc.find('span.second').bind('$destroy', spy2); 19 | }); 20 | 21 | afterEach(function() { 22 | expect(divSpy).not.toHaveBeenCalled(); 23 | 24 | expect(spy1).toHaveBeenCalled(); 25 | expect(spy1.callCount).toEqual(1); 26 | expect(spy2).toHaveBeenCalled(); 27 | expect(spy2.callCount).toEqual(1); 28 | }); 29 | 30 | describe('$detach event', function() { 31 | 32 | it('should fire on detach()', function() { 33 | doc.find('span').detach(); 34 | }); 35 | 36 | it('should fire on remove()', function() { 37 | doc.find('span').remove(); 38 | }); 39 | 40 | it('should fire on replaceWith()', function() { 41 | doc.find('span').replaceWith('bla'); 42 | }); 43 | 44 | it('should fire on replaceAll()', function() { 45 | $('bla').replaceAll(doc.find('span')); 46 | }); 47 | 48 | it('should fire on empty()', function() { 49 | doc.empty(); 50 | }); 51 | 52 | it('should fire on html()', function() { 53 | doc.html('abc'); 54 | }); 55 | }); 56 | }); 57 | } 58 | -------------------------------------------------------------------------------- /test/jquery_alias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var _jQuery = jQuery, 4 | _jqLiteMode = false; 5 | -------------------------------------------------------------------------------- /test/jquery_remove.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var _jQuery = jQuery.noConflict(true), 4 | _jqLiteMode = true; 5 | -------------------------------------------------------------------------------- /test/loaderSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('module loader', function() { 4 | var window; 5 | 6 | beforeEach(function () { 7 | window = {}; 8 | setupModuleLoader(window); 9 | }); 10 | 11 | 12 | it('should set up namespace', function() { 13 | expect(window.angular).toBeDefined(); 14 | expect(window.angular.module).toBeDefined(); 15 | }); 16 | 17 | 18 | it('should not override existing namespace', function() { 19 | var angular = window.angular; 20 | var module = angular.module; 21 | 22 | setupModuleLoader(window); 23 | expect(window.angular).toBe(angular); 24 | expect(window.angular.module).toBe(module); 25 | }); 26 | 27 | 28 | it('should record calls', function() { 29 | var otherModule = window.angular.module('other', []); 30 | otherModule.config('otherInit'); 31 | 32 | var myModule = window.angular.module('my', ['other'], 'config'); 33 | 34 | expect(myModule. 35 | provider('sk', 'sv'). 36 | factory('fk', 'fv'). 37 | service('a', 'aa'). 38 | value('k', 'v'). 39 | filter('f', 'ff'). 40 | directive('d', 'dd'). 41 | controller('ctrl', 'ccc'). 42 | config('init2'). 43 | constant('abc', 123). 44 | run('runBlock')).toBe(myModule); 45 | 46 | expect(myModule.requires).toEqual(['other']); 47 | expect(myModule._invokeQueue).toEqual([ 48 | ['$provide', 'constant', ['abc', 123] ], 49 | ['$injector', 'invoke', ['config'] ], 50 | ['$provide', 'provider', ['sk', 'sv'] ], 51 | ['$provide', 'factory', ['fk', 'fv'] ], 52 | ['$provide', 'service', ['a', 'aa'] ], 53 | ['$provide', 'value', ['k', 'v'] ], 54 | ['$filterProvider', 'register', ['f', 'ff'] ], 55 | ['$compileProvider', 'directive', ['d', 'dd'] ], 56 | ['$controllerProvider', 'register', ['ctrl', 'ccc']], 57 | ['$injector', 'invoke', ['init2'] ] 58 | ]); 59 | expect(myModule._runBlocks).toEqual(['runBlock']); 60 | }); 61 | 62 | 63 | it('should allow module redefinition', function() { 64 | expect(window.angular.module('a', [])).not.toBe(window.angular.module('a', [])); 65 | }); 66 | 67 | 68 | it('should complain of no module', function() { 69 | expect(function() { 70 | window.angular.module('dontExist'); 71 | }).toThrow('No module: dontExist'); 72 | }); 73 | }); 74 | -------------------------------------------------------------------------------- /test/ng/directive/aSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('a', function() { 4 | var element, $compile, $rootScope; 5 | 6 | 7 | beforeEach(inject(function(_$compile_, _$rootScope_) { 8 | $compile = _$compile_; 9 | $rootScope = _$rootScope_; 10 | })); 11 | 12 | 13 | afterEach(function(){ 14 | dealoc(element); 15 | }); 16 | 17 | 18 | it('should prevent default action to be executed when href is empty', function() { 19 | var orgLocation = document.location.href, 20 | preventDefaultCalled = false, 21 | event; 22 | 23 | element = $compile('empty link')($rootScope); 24 | 25 | if (msie < 9) { 26 | 27 | event = document.createEventObject(); 28 | expect(event.returnValue).not.toBeDefined(); 29 | element[0].fireEvent('onclick', event); 30 | expect(event.returnValue).toEqual(false); 31 | 32 | } else { 33 | 34 | event = document.createEvent('MouseEvent'); 35 | event.initMouseEvent( 36 | 'click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 37 | 38 | event.preventDefaultOrg = event.preventDefault; 39 | event.preventDefault = function() { 40 | preventDefaultCalled = true; 41 | if (this.preventDefaultOrg) this.preventDefaultOrg(); 42 | }; 43 | 44 | element[0].dispatchEvent(event); 45 | 46 | expect(preventDefaultCalled).toEqual(true); 47 | } 48 | 49 | expect(document.location.href).toEqual(orgLocation); 50 | }); 51 | 52 | 53 | it('should prevent IE for changing text content when setting attribute', function() { 54 | // see issue #1949 55 | element = jqLite('hello@you'); 56 | $compile(element); 57 | element.attr('href', 'bye@me'); 58 | 59 | expect(element.text()).toBe('hello@you'); 60 | }); 61 | }); 62 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /test/ng/directive/ngControllerSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngController', function() { 4 | var element; 5 | 6 | beforeEach(inject(function($window) { 7 | $window.Greeter = function($scope) { 8 | // private stuff (not exported to scope) 9 | this.prefix = 'Hello '; 10 | 11 | // public stuff (exported to scope) 12 | var ctrl = this; 13 | $scope.name = 'Misko'; 14 | $scope.greet = function(name) { 15 | return ctrl.prefix + name + ctrl.suffix; 16 | }; 17 | 18 | $scope.protoGreet = bind(this, this.protoGreet); 19 | }; 20 | $window.Greeter.prototype = { 21 | suffix: '!', 22 | protoGreet: function(name) { 23 | return this.prefix + name + this.suffix; 24 | } 25 | }; 26 | 27 | $window.Child = function($scope) { 28 | $scope.name = 'Adam'; 29 | }; 30 | })); 31 | 32 | afterEach(function() { 33 | dealoc(element); 34 | }); 35 | 36 | 37 | it('should instantiate controller and bind methods', inject(function($compile, $rootScope) { 38 | element = $compile('
{{greet(name)}}
')($rootScope); 39 | $rootScope.$digest(); 40 | expect(element.text()).toBe('Hello Misko!'); 41 | })); 42 | 43 | 44 | it('should allow nested controllers', inject(function($compile, $rootScope) { 45 | element = $compile('
{{greet(name)}}
')($rootScope); 46 | $rootScope.$digest(); 47 | expect(element.text()).toBe('Hello Adam!'); 48 | dealoc(element); 49 | 50 | element = $compile('
{{protoGreet(name)}}
')($rootScope); 51 | $rootScope.$digest(); 52 | expect(element.text()).toBe('Hello Adam!'); 53 | })); 54 | 55 | 56 | it('should instantiate controller defined on scope', inject(function($compile, $rootScope) { 57 | $rootScope.Greeter = function($scope) { 58 | $scope.name = 'Vojta'; 59 | }; 60 | 61 | element = $compile('
{{name}}
')($rootScope); 62 | $rootScope.$digest(); 63 | expect(element.text()).toBe('Vojta'); 64 | })); 65 | }); 66 | -------------------------------------------------------------------------------- /test/ng/directive/ngCspSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngCsp', function() { 4 | 5 | it('it should turn on CSP mode in $sniffer', inject(function($sniffer, $compile) { 6 | expect($sniffer.csp).toBe(false); 7 | $compile('
'); 8 | expect($sniffer.csp).toBe(true); 9 | })); 10 | }); 11 | -------------------------------------------------------------------------------- /test/ng/directive/ngEventDirsSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('event directives', function() { 4 | var element; 5 | 6 | 7 | afterEach(function() { 8 | dealoc(element); 9 | }); 10 | 11 | 12 | describe('ngSubmit', function() { 13 | 14 | it('should get called on form submit', inject(function($rootScope, $compile) { 15 | element = $compile('
' + 16 | '' + 17 | '
')($rootScope); 18 | $rootScope.$digest(); 19 | expect($rootScope.submitted).not.toBeDefined(); 20 | 21 | browserTrigger(element.children()[0]); 22 | expect($rootScope.submitted).toEqual(true); 23 | })); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ng/directive/ngNonBindableSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | describe('ngNonBindable', function() { 5 | var element; 6 | 7 | 8 | afterEach(function(){ 9 | dealoc(element); 10 | }); 11 | 12 | 13 | it('should prevent compilation of the owning element and its children', 14 | inject(function($rootScope, $compile) { 15 | element = $compile('
')($rootScope); 16 | $rootScope.name = 'misko'; 17 | $rootScope.$digest(); 18 | expect(element.text()).toEqual(''); 19 | expect(element.attr('text')).toEqual('{{name}}'); 20 | })); 21 | }); 22 | -------------------------------------------------------------------------------- /test/ng/directive/ngShowHideSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngShow / ngHide', function() { 4 | var element; 5 | 6 | 7 | afterEach(function() { 8 | dealoc(element); 9 | }); 10 | 11 | describe('ngShow', function() { 12 | it('should show and hide an element', inject(function($rootScope, $compile) { 13 | element = jqLite('
'); 14 | element = $compile(element)($rootScope); 15 | $rootScope.$digest(); 16 | expect(isCssVisible(element)).toEqual(false); 17 | $rootScope.exp = true; 18 | $rootScope.$digest(); 19 | expect(isCssVisible(element)).toEqual(true); 20 | })); 21 | 22 | 23 | it('should make hidden element visible', inject(function($rootScope, $compile) { 24 | element = jqLite('
'); 25 | element = $compile(element)($rootScope); 26 | expect(isCssVisible(element)).toBe(false); 27 | $rootScope.exp = true; 28 | $rootScope.$digest(); 29 | expect(isCssVisible(element)).toBe(true); 30 | })); 31 | }); 32 | 33 | describe('ngHide', function() { 34 | it('should hide an element', inject(function($rootScope, $compile) { 35 | element = jqLite('
'); 36 | element = $compile(element)($rootScope); 37 | expect(isCssVisible(element)).toBe(true); 38 | $rootScope.exp = true; 39 | $rootScope.$digest(); 40 | expect(isCssVisible(element)).toBe(false); 41 | })); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /test/ng/directive/ngSrcSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('ngSrc', function() { 4 | var element; 5 | 6 | afterEach(function() { 7 | dealoc(element); 8 | }); 9 | 10 | it('should not result empty string in img src', inject(function($rootScope, $compile) { 11 | $rootScope.image = {}; 12 | element = $compile('')($rootScope); 13 | $rootScope.$digest(); 14 | expect(element.attr('src')).not.toBe(''); 15 | expect(element.attr('src')).toBe(undefined); 16 | })); 17 | }); 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ng/directive/styleSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('style', function() { 4 | var element; 5 | 6 | 7 | afterEach(function() { 8 | dealoc(element); 9 | }); 10 | 11 | 12 | it('should not compile style element', inject(function($compile, $rootScope) { 13 | element = jqLite(''); 14 | $compile(element)($rootScope); 15 | $rootScope.$digest(); 16 | 17 | // read innerHTML and trim to pass on IE8 18 | expect(trim(element[0].innerHTML)).toBe('should {{notBound}}'); 19 | })); 20 | 21 | 22 | it('should compile content of element with style attr', inject(function($compile, $rootScope) { 23 | element = jqLite('
{{bind}}
'); 24 | $compile(element)($rootScope); 25 | $rootScope.$apply(function() { 26 | $rootScope.bind = 'value'; 27 | }); 28 | 29 | expect(element.text()).toBe('value'); 30 | })); 31 | }); 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ng/exceptionHandlerSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$exceptionHandler', function() { 4 | it('should log errors with single argument', function() { 5 | module(function($provide){ 6 | $provide.provider('$exceptionHandler', $ExceptionHandlerProvider); 7 | }); 8 | inject(function($log, $exceptionHandler) { 9 | $exceptionHandler('myError'); 10 | expect($log.error.logs.shift()).toEqual(['myError']); 11 | }); 12 | }); 13 | 14 | 15 | it('should log errors with multiple arguments', function() { 16 | module(function($provide){ 17 | $provide.provider('$exceptionHandler', $ExceptionHandlerProvider); 18 | }); 19 | inject(function($log, $exceptionHandler) { 20 | $exceptionHandler('myError', 'comment'); 21 | expect($log.error.logs.shift()).toEqual(['myError', 'comment']); 22 | }); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /test/ng/filter/orderBySpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('Filter: orderBy', function() { 4 | var orderBy; 5 | beforeEach(inject(function($filter) { 6 | orderBy = $filter('orderBy'); 7 | })); 8 | 9 | it('should return same array if predicate is falsy', function() { 10 | var array = [1, 2, 3]; 11 | expect(orderBy(array)).toBe(array); 12 | }); 13 | 14 | it('shouldSortArrayInReverse', function() { 15 | expect(orderBy([{a:15}, {a:2}], 'a', true)).toEqualData([{a:15}, {a:2}]); 16 | expect(orderBy([{a:15}, {a:2}], 'a', "T")).toEqualData([{a:15}, {a:2}]); 17 | expect(orderBy([{a:15}, {a:2}], 'a', "reverse")).toEqualData([{a:15}, {a:2}]); 18 | }); 19 | 20 | it('should sort array by predicate', function() { 21 | expect(orderBy([{a:15, b:1}, {a:2, b:1}], ['a', 'b'])).toEqualData([{a:2, b:1}, {a:15, b:1}]); 22 | expect(orderBy([{a:15, b:1}, {a:2, b:1}], ['b', 'a'])).toEqualData([{a:2, b:1}, {a:15, b:1}]); 23 | expect(orderBy([{a:15, b:1}, {a:2, b:1}], ['+b', '-a'])).toEqualData([{a:15, b:1}, {a:2, b:1}]); 24 | }); 25 | 26 | it('should use function', function() { 27 | expect( 28 | orderBy( 29 | [{a:15, b:1},{a:2, b:1}], 30 | function(value) { return value.a; })). 31 | toEqual([{a:2, b:1},{a:15, b:1}]); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /test/ng/localeSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$locale', function() { 4 | 5 | var $locale = new $LocaleProvider().$get(); 6 | 7 | it('should have locale id set to en-us', function() { 8 | expect($locale.id).toBe('en-us'); 9 | }); 10 | 11 | 12 | it('should have NUMBER_FORMATS', function() { 13 | var numberFormats = $locale.NUMBER_FORMATS; 14 | expect(numberFormats).toBeDefined(); 15 | expect(numberFormats.PATTERNS.length).toBe(2); 16 | angular.forEach(numberFormats.PATTERNS, function(pattern) { 17 | expect(pattern.minInt).toBeDefined(); 18 | expect(pattern.minFrac).toBeDefined(); 19 | expect(pattern.maxFrac).toBeDefined(); 20 | expect(pattern.posPre).toBeDefined(); 21 | expect(pattern.posSuf).toBeDefined(); 22 | expect(pattern.negPre).toBeDefined(); 23 | expect(pattern.negSuf).toBeDefined(); 24 | expect(pattern.gSize).toBeDefined(); 25 | expect(pattern.lgSize).toBeDefined(); 26 | }); 27 | }); 28 | 29 | 30 | it('should have DATETIME_FORMATS', function() { 31 | var datetime = $locale.DATETIME_FORMATS; 32 | expect(datetime).toBeDefined(); 33 | expect(datetime.DAY.length).toBe(7); 34 | expect(datetime.SHORTDAY.length).toBe(7); 35 | expect(datetime.SHORTMONTH.length).toBe(12); 36 | expect(datetime.MONTH.length).toBe(12); 37 | expect(datetime.AMPMS.length).toBe(2); 38 | }); 39 | 40 | 41 | it('should return correct plural types', function() { 42 | expect($locale.pluralCat(-1)).toBe('other'); 43 | expect($locale.pluralCat(0)).toBe('other'); 44 | expect($locale.pluralCat(2)).toBe('other'); 45 | expect($locale.pluralCat(1)).toBe('one'); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ng/routeParamsSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('$routeParams', function() { 4 | it('should publish the params into a service', function() { 5 | module(function($routeProvider) { 6 | $routeProvider.when('/foo', {}); 7 | $routeProvider.when('/bar/:barId', {}); 8 | }); 9 | 10 | inject(function($rootScope, $route, $location, $routeParams) { 11 | $location.path('/foo').search('a=b'); 12 | $rootScope.$digest(); 13 | expect($routeParams).toEqual({a:'b'}); 14 | 15 | $location.path('/bar/123').search('x=abc'); 16 | $rootScope.$digest(); 17 | expect($routeParams).toEqual({barId:'123', x:'abc'}); 18 | }); 19 | }); 20 | 21 | it('should correctly extract the params when a param name is part of the route', function() { 22 | module(function($routeProvider) { 23 | $routeProvider.when('/bar/:foo/:bar', {}); 24 | }); 25 | 26 | inject(function($rootScope, $route, $location, $routeParams) { 27 | $location.path('/bar/foovalue/barvalue'); 28 | $rootScope.$digest(); 29 | expect($routeParams).toEqual({bar:'barvalue', foo:'foovalue'}); 30 | }); 31 | }); 32 | 33 | it('should support route params not preceded by slashes', function() { 34 | module(function($routeProvider) { 35 | $routeProvider.when('/bar:barId/foo:fooId/', {}); 36 | }); 37 | 38 | inject(function($rootScope, $route, $location, $routeParams) { 39 | $location.path('/barbarvalue/foofoovalue/'); 40 | $rootScope.$digest(); 41 | expect($routeParams).toEqual({barId: 'barvalue', fooId: 'foovalue'}); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ngSanitize/filter/linkySpec.js: -------------------------------------------------------------------------------- 1 | describe('linky', function() { 2 | var linky; 3 | 4 | beforeEach(module('ngSanitize')); 5 | 6 | beforeEach(inject(function($filter){ 7 | linky = $filter('linky'); 8 | })); 9 | 10 | it('should do basic filter', function() { 11 | expect(linky("http://ab/ (http://a/) http://1.2/v:~-123. c")). 12 | toEqual('http://ab/ ' + 13 | '(http://a/) ' + 14 | '<http://a/> ' + 15 | 'http://1.2/v:~-123. c'); 16 | expect(linky(undefined)).not.toBeDefined(); 17 | }); 18 | 19 | it('should handle mailto:', function() { 20 | expect(linky("mailto:me@example.com")). 21 | toEqual('me@example.com'); 22 | expect(linky("me@example.com")). 23 | toEqual('me@example.com'); 24 | expect(linky("send email to me@example.com, but")). 25 | toEqual('send email to me@example.com, but'); 26 | }); 27 | 28 | it('should handle target:', function() { 29 | expect(linky("http://example.com", "_blank")). 30 | toEqual('http://example.com') 31 | expect(linky("http://example.com", "someNamedIFrame")). 32 | toEqual('http://example.com') 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ngScenario/e2e/Runner-compiled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/ngScenario/e2e/Runner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ngScenario/matchersSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('angular.scenario.matchers', function () { 4 | var matchers; 5 | 6 | function expectMatcher(value, test) { 7 | delete matchers.error; 8 | delete matchers.future.value; 9 | if (value !== undefined) { 10 | matchers.future.value = value; 11 | } 12 | test(); 13 | expect(matchers.error).toBeUndefined(); 14 | } 15 | 16 | beforeEach(function() { 17 | /** 18 | * Mock up the future system wrapped around matchers. 19 | * 20 | * @see Scenario.js#angular.scenario.matcher 21 | */ 22 | matchers = { 23 | future: { name: 'test' } 24 | }; 25 | matchers.addFuture = function(name, callback) { 26 | callback(function(error) { 27 | matchers.error = error; 28 | }); 29 | }; 30 | angular.extend(matchers, angular.scenario.matcher); 31 | }); 32 | 33 | it('should handle basic matching', function() { 34 | expectMatcher(10, function() { matchers.toEqual(10); }); 35 | expectMatcher('value', function() { matchers.toBeDefined(); }); 36 | expectMatcher([1], function() { matchers.toBeTruthy(); }); 37 | expectMatcher("", function() { matchers.toBeFalsy(); }); 38 | expectMatcher(0, function() { matchers.toBeFalsy(); }); 39 | expectMatcher('foo', function() { matchers.toMatch('.o.'); }); 40 | expectMatcher(null, function() { matchers.toBeNull(); }); 41 | expectMatcher([1, 2, 3], function() { matchers.toContain(2); }); 42 | expectMatcher(3, function() { matchers.toBeLessThan(10); }); 43 | expectMatcher(3, function() { matchers.toBeGreaterThan(-5); }); 44 | }); 45 | 46 | it('should have toHaveClass matcher', function(){ 47 | var e = angular.element('
'); 48 | expect(e).not.toHaveClass('none'); 49 | expect(e).toHaveClass('abc'); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/ngScenario/output/xmlSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('angular.scenario.output.xml', 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.xml(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 create XML nodes for object model', 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 | expect(context.find('it').attr('status')).toEqual('success'); 34 | expect(context.find('it step').attr('status')).toEqual('success'); 35 | }); 36 | 37 | it('should output errors to the XML', function() { 38 | runner.emit('SpecBegin', spec); 39 | runner.emit('StepBegin', spec, step); 40 | runner.emit('StepFailure', spec, step, 'error reason'); 41 | runner.emit('StepEnd', spec, step); 42 | runner.emit('SpecEnd', spec); 43 | runner.emit('RunnerEnd'); 44 | 45 | expect(context.find('it').attr('status')).toEqual('failure'); 46 | expect(context.find('it step').attr('status')).toEqual('failure'); 47 | expect(context.find('it step').text()).toEqual('error reason'); 48 | }); 49 | }); 50 | -------------------------------------------------------------------------------- /testacular-e2e.conf.js: -------------------------------------------------------------------------------- 1 | var angularFiles = require(__dirname + '/angularFiles.js'); 2 | 3 | files = [ANGULAR_SCENARIO, ANGULAR_SCENARIO_ADAPTER, 'build/docs/docs-scenario.js']; 4 | 5 | autoWatch = false; 6 | singleRun = true; 7 | logLevel = LOG_INFO; 8 | logColors = true; 9 | browsers = ['Chrome']; 10 | 11 | proxies = { 12 | // angular.js, angular-resource.js, etc 13 | '/angular': 'http://localhost:8000/build/angular', 14 | '/': 'http://localhost:8000/build/docs/' 15 | }; 16 | 17 | junitReporter = { 18 | outputFile: 'test_out/e2e.xml', 19 | suite: 'E2E' 20 | }; 21 | -------------------------------------------------------------------------------- /testacular-jqlite.conf.js: -------------------------------------------------------------------------------- 1 | var angularFiles = require(__dirname + '/angularFiles.js'); 2 | 3 | files = angularFiles.mergeFiles(JASMINE, JASMINE_ADAPTER, 'jstd'); 4 | exclude = ['**/*jasmine*/**', '**/*jstd*/**'].concat(angularFiles.files.jstdExclude); 5 | 6 | autoWatch = true; 7 | logLevel = LOG_INFO; 8 | logColors = true; 9 | browsers = ['Chrome']; 10 | 11 | junitReporter = { 12 | outputFile: 'test_out/jqlite.xml', 13 | suite: 'jqLite' 14 | }; 15 | -------------------------------------------------------------------------------- /testacular-jquery.conf.js: -------------------------------------------------------------------------------- 1 | var angularFiles = require(__dirname + '/angularFiles.js'); 2 | 3 | files = angularFiles.mergeFiles(JASMINE, JASMINE_ADAPTER, 'jstdJquery'); 4 | exclude = ['**/*jasmine*/**', '**/*jstd*/**'].concat(angularFiles.files.jstdJqueryExclude); 5 | 6 | autoWatch = true; 7 | logLevel = LOG_INFO; 8 | logColors = true; 9 | browsers = ['Chrome']; 10 | 11 | junitReporter = { 12 | outputFile: 'test_out/jquery.xml', 13 | suite: 'jQuery' 14 | }; 15 | -------------------------------------------------------------------------------- /testacular-modules.conf.js: -------------------------------------------------------------------------------- 1 | var angularFiles = require(__dirname + '/angularFiles.js'); 2 | 3 | files = angularFiles.mergeFiles(JASMINE, JASMINE_ADAPTER, 'jstdModules', 'angularSrcModules'); 4 | exclude = ['**/*jasmine*/**', '**/*jstd*/**']; 5 | 6 | autoWatch = true; 7 | logLevel = LOG_INFO; 8 | logColors = true; 9 | browsers = ['Chrome']; 10 | 11 | junitReporter = { 12 | outputFile: 'test_out/modules.xml', 13 | suite: 'modules' 14 | }; 15 | -------------------------------------------------------------------------------- /version.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var FILE = 'version.yaml'; 4 | var fs = require('fs'); 5 | var optimist = require('optimist'); 6 | 7 | optimist 8 | .usage('Manage ' + FILE + '.\nUsage: $0 [options]') 9 | .describe('remove-snapshot', 'Remove -snapshot suffix.') 10 | .describe('minor-bump', 'Bump minor version one step.') 11 | .describe('minor-next', 'Return next minor version.') 12 | .describe('current', 'Return current verion') 13 | .describe('help', 'Show usage'); 14 | 15 | 16 | var bumpMinor = function(version) { 17 | var parts = version.split('.'); 18 | var last = parts.pop(); 19 | 20 | var rc = last.match(/(\d*)rc(\d*)/); 21 | if (rc) { 22 | parts.push(rc[1] + 'rc' + (parseInt(rc[2], 10) + 1)); 23 | } else { 24 | parts.push('' + (parseInt(last, 10) + 1)); 25 | } 26 | 27 | return parts.join('.'); 28 | }; 29 | 30 | fs.readFile(FILE, 'utf8', function(err, content) { 31 | var version = content.match(/version\:\s([^\-\n]*)/)[1]; 32 | 33 | var args = optimist.argv; 34 | if (args['remove-snapshot']) { 35 | fs.writeFile(FILE, content.replace('-snapshot', ''), function(err) { 36 | if (!err) { 37 | console.log('Version updated (removed -snapshot).'); 38 | process.exit(0); 39 | } else { 40 | console.error('Version update failed.'); 41 | process.exit(1); 42 | } 43 | }); 44 | } else if (args['minor-next']) { 45 | process.stdout.write(bumpMinor(version) + '\n'); 46 | process.exit(0); 47 | } else if (args['current']) { 48 | process.stdout.write(version + '\n'); 49 | process.exit(0); 50 | } else if (args['minor-bump']) { 51 | var bumped = bumpMinor(version); 52 | 53 | if (!content.match(/\-snapshot/)) bumped += '-snapshot'; 54 | fs.writeFile(FILE, content.replace(version, bumped), function(err) { 55 | if (!err) { 56 | console.log('Version updated (bumped to ' + bumped + ').'); 57 | process.exit(0); 58 | } else { 59 | console.error('Version update failed.'); 60 | process.exit(1); 61 | } 62 | }); 63 | } else { 64 | console.log(optimist.help()); 65 | process.exit(args['help'] ? 0 : 1); 66 | } 67 | }); 68 | -------------------------------------------------------------------------------- /version.yaml: -------------------------------------------------------------------------------- 1 | # AngularJS build config file 2 | --- 3 | version: 1.1.4-snapshot 4 | codename: quantum-manipulation 5 | stable: 1.0.5 6 | -------------------------------------------------------------------------------- /watchr-docs.rb: -------------------------------------------------------------------------------- 1 | # config file for watchr http://github.com/mynyml/watchr 2 | # install: gem install watchr 3 | # run: watch watchr-docs.rb 4 | 5 | watch( '^src/|^docs/' ) do 6 | system 'echo "\n\ndoc run started @ `date`"; node docs/src/gen-docs.js' 7 | end 8 | --------------------------------------------------------------------------------