From c19288cd73efdde914658d6f4facd6b0aaec0f79 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Fri, 13 Dec 2013 15:33:07 -0800 Subject: [PATCH 01/15] BUMP ANGULAR VERSION to 1.2.5 --- app/index-async.html | 4 +- app/lib/angular/angular-animate.js | 4 +- app/lib/angular/angular-animate.min.js | 4 +- app/lib/angular/angular-animate.min.js.map | 4 +- app/lib/angular/angular-cookies.js | 2 +- app/lib/angular/angular-cookies.min.js | 2 +- app/lib/angular/angular-cookies.min.js.map | 0 app/lib/angular/angular-csp.css | 0 app/lib/angular/angular-loader.js | 4 +- app/lib/angular/angular-loader.min.js | 4 +- app/lib/angular/angular-loader.min.js.map | 0 app/lib/angular/angular-mocks.js | 7 +- app/lib/angular/angular-resource.js | 27 +- app/lib/angular/angular-resource.min.js | 15 +- app/lib/angular/angular-resource.min.js.map | 6 +- app/lib/angular/angular-route.js | 84 +- app/lib/angular/angular-route.min.js | 18 +- app/lib/angular/angular-route.min.js.map | 4 +- app/lib/angular/angular-sanitize.js | 2 +- app/lib/angular/angular-sanitize.min.js | 2 +- app/lib/angular/angular-sanitize.min.js.map | 0 app/lib/angular/angular-scenario.js | 266 ++++--- app/lib/angular/angular-touch.js | 2 +- app/lib/angular/angular-touch.min.js | 2 +- app/lib/angular/angular-touch.min.js.map | 0 app/lib/angular/angular.js | 266 ++++--- app/lib/angular/angular.min.js | 390 ++++----- app/lib/angular/angular.min.js.map | 4 +- app/lib/angular/errors.json | 2 +- app/lib/angular/i18n/angular-locale_af-na.js | 0 app/lib/angular/i18n/angular-locale_af-za.js | 0 app/lib/angular/i18n/angular-locale_af.js | 0 app/lib/angular/i18n/angular-locale_am-et.js | 0 app/lib/angular/i18n/angular-locale_am.js | 0 app/lib/angular/i18n/angular-locale_ar-001.js | 0 app/lib/angular/i18n/angular-locale_ar-ae.js | 0 app/lib/angular/i18n/angular-locale_ar-bh.js | 0 app/lib/angular/i18n/angular-locale_ar-dz.js | 0 app/lib/angular/i18n/angular-locale_ar-eg.js | 0 app/lib/angular/i18n/angular-locale_ar-iq.js | 0 app/lib/angular/i18n/angular-locale_ar-jo.js | 0 app/lib/angular/i18n/angular-locale_ar-kw.js | 0 app/lib/angular/i18n/angular-locale_ar-lb.js | 0 app/lib/angular/i18n/angular-locale_ar-ly.js | 0 app/lib/angular/i18n/angular-locale_ar-ma.js | 0 app/lib/angular/i18n/angular-locale_ar-om.js | 0 app/lib/angular/i18n/angular-locale_ar-qa.js | 0 app/lib/angular/i18n/angular-locale_ar-sa.js | 0 app/lib/angular/i18n/angular-locale_ar-sd.js | 0 app/lib/angular/i18n/angular-locale_ar-sy.js | 0 app/lib/angular/i18n/angular-locale_ar-tn.js | 0 app/lib/angular/i18n/angular-locale_ar-ye.js | 0 app/lib/angular/i18n/angular-locale_ar.js | 0 app/lib/angular/i18n/angular-locale_bg-bg.js | 0 app/lib/angular/i18n/angular-locale_bg.js | 0 app/lib/angular/i18n/angular-locale_bn-bd.js | 0 app/lib/angular/i18n/angular-locale_bn-in.js | 0 app/lib/angular/i18n/angular-locale_bn.js | 0 app/lib/angular/i18n/angular-locale_ca-ad.js | 0 app/lib/angular/i18n/angular-locale_ca-es.js | 0 app/lib/angular/i18n/angular-locale_ca.js | 0 app/lib/angular/i18n/angular-locale_cs-cz.js | 0 app/lib/angular/i18n/angular-locale_cs.js | 0 app/lib/angular/i18n/angular-locale_da-dk.js | 0 app/lib/angular/i18n/angular-locale_da.js | 0 app/lib/angular/i18n/angular-locale_de-at.js | 0 app/lib/angular/i18n/angular-locale_de-be.js | 0 app/lib/angular/i18n/angular-locale_de-ch.js | 0 app/lib/angular/i18n/angular-locale_de-de.js | 0 app/lib/angular/i18n/angular-locale_de-li.js | 0 app/lib/angular/i18n/angular-locale_de-lu.js | 0 app/lib/angular/i18n/angular-locale_de.js | 0 app/lib/angular/i18n/angular-locale_el-cy.js | 0 app/lib/angular/i18n/angular-locale_el-gr.js | 0 app/lib/angular/i18n/angular-locale_el.js | 0 app/lib/angular/i18n/angular-locale_en-as.js | 0 app/lib/angular/i18n/angular-locale_en-au.js | 0 app/lib/angular/i18n/angular-locale_en-bb.js | 0 app/lib/angular/i18n/angular-locale_en-be.js | 0 app/lib/angular/i18n/angular-locale_en-bm.js | 0 app/lib/angular/i18n/angular-locale_en-bw.js | 0 app/lib/angular/i18n/angular-locale_en-bz.js | 0 app/lib/angular/i18n/angular-locale_en-ca.js | 0 .../angular/i18n/angular-locale_en-dsrt-us.js | 0 .../angular/i18n/angular-locale_en-dsrt.js | 0 app/lib/angular/i18n/angular-locale_en-fm.js | 0 app/lib/angular/i18n/angular-locale_en-gb.js | 0 app/lib/angular/i18n/angular-locale_en-gu.js | 0 app/lib/angular/i18n/angular-locale_en-gy.js | 0 app/lib/angular/i18n/angular-locale_en-hk.js | 0 app/lib/angular/i18n/angular-locale_en-ie.js | 0 app/lib/angular/i18n/angular-locale_en-in.js | 0 app/lib/angular/i18n/angular-locale_en-iso.js | 0 app/lib/angular/i18n/angular-locale_en-jm.js | 0 app/lib/angular/i18n/angular-locale_en-mh.js | 0 app/lib/angular/i18n/angular-locale_en-mp.js | 0 app/lib/angular/i18n/angular-locale_en-mt.js | 0 app/lib/angular/i18n/angular-locale_en-mu.js | 0 app/lib/angular/i18n/angular-locale_en-na.js | 0 app/lib/angular/i18n/angular-locale_en-nz.js | 0 app/lib/angular/i18n/angular-locale_en-ph.js | 0 app/lib/angular/i18n/angular-locale_en-pk.js | 0 app/lib/angular/i18n/angular-locale_en-pr.js | 0 app/lib/angular/i18n/angular-locale_en-pw.js | 0 app/lib/angular/i18n/angular-locale_en-sg.js | 0 app/lib/angular/i18n/angular-locale_en-tc.js | 0 app/lib/angular/i18n/angular-locale_en-tt.js | 0 app/lib/angular/i18n/angular-locale_en-um.js | 0 app/lib/angular/i18n/angular-locale_en-us.js | 0 app/lib/angular/i18n/angular-locale_en-vg.js | 0 app/lib/angular/i18n/angular-locale_en-vi.js | 0 app/lib/angular/i18n/angular-locale_en-za.js | 0 app/lib/angular/i18n/angular-locale_en-zw.js | 0 app/lib/angular/i18n/angular-locale_en.js | 0 app/lib/angular/i18n/angular-locale_es-419.js | 0 app/lib/angular/i18n/angular-locale_es-ar.js | 0 app/lib/angular/i18n/angular-locale_es-bo.js | 0 app/lib/angular/i18n/angular-locale_es-cl.js | 0 app/lib/angular/i18n/angular-locale_es-co.js | 0 app/lib/angular/i18n/angular-locale_es-cr.js | 0 app/lib/angular/i18n/angular-locale_es-do.js | 0 app/lib/angular/i18n/angular-locale_es-ea.js | 0 app/lib/angular/i18n/angular-locale_es-ec.js | 0 app/lib/angular/i18n/angular-locale_es-es.js | 0 app/lib/angular/i18n/angular-locale_es-gq.js | 0 app/lib/angular/i18n/angular-locale_es-gt.js | 0 app/lib/angular/i18n/angular-locale_es-hn.js | 0 app/lib/angular/i18n/angular-locale_es-ic.js | 0 app/lib/angular/i18n/angular-locale_es-mx.js | 0 app/lib/angular/i18n/angular-locale_es-ni.js | 0 app/lib/angular/i18n/angular-locale_es-pa.js | 0 app/lib/angular/i18n/angular-locale_es-pe.js | 0 app/lib/angular/i18n/angular-locale_es-pr.js | 0 app/lib/angular/i18n/angular-locale_es-py.js | 0 app/lib/angular/i18n/angular-locale_es-sv.js | 0 app/lib/angular/i18n/angular-locale_es-us.js | 0 app/lib/angular/i18n/angular-locale_es-uy.js | 0 app/lib/angular/i18n/angular-locale_es-ve.js | 0 app/lib/angular/i18n/angular-locale_es.js | 0 app/lib/angular/i18n/angular-locale_et-ee.js | 0 app/lib/angular/i18n/angular-locale_et.js | 0 app/lib/angular/i18n/angular-locale_eu-es.js | 0 app/lib/angular/i18n/angular-locale_eu.js | 0 app/lib/angular/i18n/angular-locale_fa-af.js | 0 app/lib/angular/i18n/angular-locale_fa-ir.js | 0 app/lib/angular/i18n/angular-locale_fa.js | 0 app/lib/angular/i18n/angular-locale_fi-fi.js | 0 app/lib/angular/i18n/angular-locale_fi.js | 0 app/lib/angular/i18n/angular-locale_fil-ph.js | 0 app/lib/angular/i18n/angular-locale_fil.js | 0 app/lib/angular/i18n/angular-locale_fr-be.js | 0 app/lib/angular/i18n/angular-locale_fr-bf.js | 0 app/lib/angular/i18n/angular-locale_fr-bi.js | 0 app/lib/angular/i18n/angular-locale_fr-bj.js | 0 app/lib/angular/i18n/angular-locale_fr-bl.js | 0 app/lib/angular/i18n/angular-locale_fr-ca.js | 0 app/lib/angular/i18n/angular-locale_fr-cd.js | 0 app/lib/angular/i18n/angular-locale_fr-cf.js | 0 app/lib/angular/i18n/angular-locale_fr-cg.js | 0 app/lib/angular/i18n/angular-locale_fr-ch.js | 0 app/lib/angular/i18n/angular-locale_fr-ci.js | 0 app/lib/angular/i18n/angular-locale_fr-cm.js | 0 app/lib/angular/i18n/angular-locale_fr-dj.js | 0 app/lib/angular/i18n/angular-locale_fr-fr.js | 0 app/lib/angular/i18n/angular-locale_fr-ga.js | 0 app/lib/angular/i18n/angular-locale_fr-gf.js | 0 app/lib/angular/i18n/angular-locale_fr-gn.js | 0 app/lib/angular/i18n/angular-locale_fr-gp.js | 0 app/lib/angular/i18n/angular-locale_fr-gq.js | 0 app/lib/angular/i18n/angular-locale_fr-km.js | 0 app/lib/angular/i18n/angular-locale_fr-lu.js | 0 app/lib/angular/i18n/angular-locale_fr-mc.js | 0 app/lib/angular/i18n/angular-locale_fr-mf.js | 0 app/lib/angular/i18n/angular-locale_fr-mg.js | 0 app/lib/angular/i18n/angular-locale_fr-ml.js | 0 app/lib/angular/i18n/angular-locale_fr-mq.js | 0 app/lib/angular/i18n/angular-locale_fr-ne.js | 0 app/lib/angular/i18n/angular-locale_fr-re.js | 0 app/lib/angular/i18n/angular-locale_fr-yt.js | 0 app/lib/angular/i18n/angular-locale_fr.js | 0 app/lib/angular/i18n/angular-locale_gl-es.js | 0 app/lib/angular/i18n/angular-locale_gl.js | 0 app/lib/angular/i18n/angular-locale_gsw-ch.js | 0 app/lib/angular/i18n/angular-locale_gsw.js | 0 app/lib/angular/i18n/angular-locale_gu-in.js | 0 app/lib/angular/i18n/angular-locale_gu.js | 0 app/lib/angular/i18n/angular-locale_he-il.js | 0 app/lib/angular/i18n/angular-locale_he.js | 0 app/lib/angular/i18n/angular-locale_hi-in.js | 0 app/lib/angular/i18n/angular-locale_hi.js | 0 app/lib/angular/i18n/angular-locale_hr-hr.js | 0 app/lib/angular/i18n/angular-locale_hr.js | 0 app/lib/angular/i18n/angular-locale_hu-hu.js | 0 app/lib/angular/i18n/angular-locale_hu.js | 0 app/lib/angular/i18n/angular-locale_id-id.js | 0 app/lib/angular/i18n/angular-locale_id.js | 0 app/lib/angular/i18n/angular-locale_in.js | 0 app/lib/angular/i18n/angular-locale_is-is.js | 0 app/lib/angular/i18n/angular-locale_is.js | 0 app/lib/angular/i18n/angular-locale_it-it.js | 0 app/lib/angular/i18n/angular-locale_it-sm.js | 0 app/lib/angular/i18n/angular-locale_it.js | 0 app/lib/angular/i18n/angular-locale_iw.js | 0 app/lib/angular/i18n/angular-locale_ja-jp.js | 0 app/lib/angular/i18n/angular-locale_ja.js | 0 app/lib/angular/i18n/angular-locale_kn-in.js | 0 app/lib/angular/i18n/angular-locale_kn.js | 0 app/lib/angular/i18n/angular-locale_ko-kr.js | 0 app/lib/angular/i18n/angular-locale_ko.js | 0 app/lib/angular/i18n/angular-locale_ln-cd.js | 0 app/lib/angular/i18n/angular-locale_ln.js | 0 app/lib/angular/i18n/angular-locale_lt-lt.js | 0 app/lib/angular/i18n/angular-locale_lt.js | 0 app/lib/angular/i18n/angular-locale_lv-lv.js | 0 app/lib/angular/i18n/angular-locale_lv.js | 0 app/lib/angular/i18n/angular-locale_ml-in.js | 0 app/lib/angular/i18n/angular-locale_ml.js | 0 app/lib/angular/i18n/angular-locale_mr-in.js | 0 app/lib/angular/i18n/angular-locale_mr.js | 0 app/lib/angular/i18n/angular-locale_ms-my.js | 0 app/lib/angular/i18n/angular-locale_ms.js | 0 app/lib/angular/i18n/angular-locale_mt-mt.js | 0 app/lib/angular/i18n/angular-locale_mt.js | 0 app/lib/angular/i18n/angular-locale_nl-cw.js | 0 app/lib/angular/i18n/angular-locale_nl-nl.js | 0 app/lib/angular/i18n/angular-locale_nl-sx.js | 0 app/lib/angular/i18n/angular-locale_nl.js | 0 app/lib/angular/i18n/angular-locale_no.js | 0 app/lib/angular/i18n/angular-locale_or-in.js | 0 app/lib/angular/i18n/angular-locale_or.js | 0 app/lib/angular/i18n/angular-locale_pl-pl.js | 0 app/lib/angular/i18n/angular-locale_pl.js | 0 app/lib/angular/i18n/angular-locale_pt-br.js | 0 app/lib/angular/i18n/angular-locale_pt-pt.js | 0 app/lib/angular/i18n/angular-locale_pt.js | 0 app/lib/angular/i18n/angular-locale_ro-ro.js | 0 app/lib/angular/i18n/angular-locale_ro.js | 0 app/lib/angular/i18n/angular-locale_ru-ru.js | 0 app/lib/angular/i18n/angular-locale_ru.js | 0 app/lib/angular/i18n/angular-locale_sk-sk.js | 0 app/lib/angular/i18n/angular-locale_sk.js | 0 app/lib/angular/i18n/angular-locale_sl-si.js | 0 app/lib/angular/i18n/angular-locale_sl.js | 0 app/lib/angular/i18n/angular-locale_sq-al.js | 0 app/lib/angular/i18n/angular-locale_sq.js | 0 .../angular/i18n/angular-locale_sr-cyrl-rs.js | 0 .../angular/i18n/angular-locale_sr-latn-rs.js | 0 app/lib/angular/i18n/angular-locale_sr.js | 0 app/lib/angular/i18n/angular-locale_sv-se.js | 0 app/lib/angular/i18n/angular-locale_sv.js | 0 app/lib/angular/i18n/angular-locale_sw-tz.js | 0 app/lib/angular/i18n/angular-locale_sw.js | 0 app/lib/angular/i18n/angular-locale_ta-in.js | 0 app/lib/angular/i18n/angular-locale_ta.js | 0 app/lib/angular/i18n/angular-locale_te-in.js | 0 app/lib/angular/i18n/angular-locale_te.js | 0 app/lib/angular/i18n/angular-locale_th-th.js | 0 app/lib/angular/i18n/angular-locale_th.js | 0 app/lib/angular/i18n/angular-locale_tl.js | 0 app/lib/angular/i18n/angular-locale_tr-tr.js | 0 app/lib/angular/i18n/angular-locale_tr.js | 0 app/lib/angular/i18n/angular-locale_uk-ua.js | 0 app/lib/angular/i18n/angular-locale_uk.js | 0 app/lib/angular/i18n/angular-locale_ur-pk.js | 0 app/lib/angular/i18n/angular-locale_ur.js | 0 app/lib/angular/i18n/angular-locale_vi-vn.js | 0 app/lib/angular/i18n/angular-locale_vi.js | 0 app/lib/angular/i18n/angular-locale_zh-cn.js | 0 .../angular/i18n/angular-locale_zh-hans-cn.js | 0 app/lib/angular/i18n/angular-locale_zh-hk.js | 0 app/lib/angular/i18n/angular-locale_zh-tw.js | 0 app/lib/angular/i18n/angular-locale_zh.js | 0 app/lib/angular/i18n/angular-locale_zu-za.js | 0 app/lib/angular/i18n/angular-locale_zu.js | 0 app/lib/angular/version.json | 2 +- app/lib/angular/version.txt | 2 +- test/lib/angular/angular-scenario.js | 738 +++++++++++------- 277 files changed, 1089 insertions(+), 778 deletions(-) mode change 100644 => 100755 app/lib/angular/angular-animate.js mode change 100644 => 100755 app/lib/angular/angular-animate.min.js mode change 100644 => 100755 app/lib/angular/angular-animate.min.js.map mode change 100644 => 100755 app/lib/angular/angular-cookies.js mode change 100644 => 100755 app/lib/angular/angular-cookies.min.js mode change 100644 => 100755 app/lib/angular/angular-cookies.min.js.map mode change 100644 => 100755 app/lib/angular/angular-csp.css mode change 100644 => 100755 app/lib/angular/angular-loader.js mode change 100644 => 100755 app/lib/angular/angular-loader.min.js mode change 100644 => 100755 app/lib/angular/angular-loader.min.js.map mode change 100644 => 100755 app/lib/angular/angular-mocks.js mode change 100644 => 100755 app/lib/angular/angular-resource.js mode change 100644 => 100755 app/lib/angular/angular-resource.min.js mode change 100644 => 100755 app/lib/angular/angular-resource.min.js.map mode change 100644 => 100755 app/lib/angular/angular-route.js mode change 100644 => 100755 app/lib/angular/angular-route.min.js mode change 100644 => 100755 app/lib/angular/angular-route.min.js.map mode change 100644 => 100755 app/lib/angular/angular-sanitize.js mode change 100644 => 100755 app/lib/angular/angular-sanitize.min.js mode change 100644 => 100755 app/lib/angular/angular-sanitize.min.js.map mode change 100644 => 100755 app/lib/angular/angular-scenario.js mode change 100644 => 100755 app/lib/angular/angular-touch.js mode change 100644 => 100755 app/lib/angular/angular-touch.min.js mode change 100644 => 100755 app/lib/angular/angular-touch.min.js.map mode change 100644 => 100755 app/lib/angular/angular.js mode change 100644 => 100755 app/lib/angular/angular.min.js mode change 100644 => 100755 app/lib/angular/angular.min.js.map mode change 100644 => 100755 app/lib/angular/errors.json mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_af-na.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_af-za.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_af.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_am-et.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_am.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-001.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-ae.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-bh.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-dz.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-eg.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-iq.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-jo.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-kw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-lb.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-ly.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-ma.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-om.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-qa.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-sa.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-sd.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-sy.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-tn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar-ye.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ar.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_bg-bg.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_bg.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_bn-bd.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_bn-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_bn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ca-ad.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ca-es.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ca.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_cs-cz.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_cs.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_da-dk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_da.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_de-at.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_de-be.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_de-ch.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_de-de.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_de-li.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_de-lu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_de.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_el-cy.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_el-gr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_el.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-as.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-au.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-bb.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-be.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-bm.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-bw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-bz.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-ca.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-dsrt-us.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-dsrt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-fm.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-gb.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-gu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-gy.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-hk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-ie.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-iso.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-jm.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-mh.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-mp.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-mt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-mu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-na.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-nz.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-ph.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-pk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-pr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-pw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-sg.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-tc.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-tt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-um.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-us.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-vg.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-vi.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-za.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en-zw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_en.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-419.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-ar.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-bo.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-cl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-co.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-cr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-do.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-ea.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-ec.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-es.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-gq.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-gt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-hn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-ic.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-mx.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-ni.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-pa.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-pe.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-pr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-py.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-sv.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-us.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-uy.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es-ve.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_es.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_et-ee.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_et.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_eu-es.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_eu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fa-af.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fa-ir.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fa.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fi-fi.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fi.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fil-ph.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fil.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-be.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-bf.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-bi.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-bj.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-bl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-ca.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-cd.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-cf.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-cg.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-ch.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-ci.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-cm.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-dj.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-fr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-ga.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-gf.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-gn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-gp.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-gq.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-km.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-lu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-mc.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-mf.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-mg.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-ml.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-mq.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-ne.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-re.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr-yt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_fr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_gl-es.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_gl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_gsw-ch.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_gsw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_gu-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_gu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_he-il.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_he.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_hi-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_hi.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_hr-hr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_hr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_hu-hu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_hu.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_id-id.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_id.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_is-is.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_is.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_it-it.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_it-sm.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_it.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_iw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ja-jp.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ja.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_kn-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_kn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ko-kr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ko.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ln-cd.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ln.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_lt-lt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_lt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_lv-lv.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_lv.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ml-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ml.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_mr-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_mr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ms-my.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ms.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_mt-mt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_mt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_nl-cw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_nl-nl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_nl-sx.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_nl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_no.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_or-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_or.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_pl-pl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_pl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_pt-br.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_pt-pt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_pt.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ro-ro.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ro.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ru-ru.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ru.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sk-sk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sl-si.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sq-al.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sq.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sr-cyrl-rs.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sr-latn-rs.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sv-se.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sv.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sw-tz.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_sw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ta-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ta.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_te-in.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_te.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_th-th.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_th.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_tl.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_tr-tr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_tr.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_uk-ua.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_uk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ur-pk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_ur.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_vi-vn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_vi.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_zh-cn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_zh-hans-cn.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_zh-hk.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_zh-tw.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_zh.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_zu-za.js mode change 100644 => 100755 app/lib/angular/i18n/angular-locale_zu.js mode change 100644 => 100755 app/lib/angular/version.json mode change 100644 => 100755 app/lib/angular/version.txt mode change 100644 => 100755 test/lib/angular/angular-scenario.js diff --git a/app/index-async.html b/app/index-async.html index 42465d8a7..33f91986f 100644 --- a/app/index-async.html +++ b/app/index-async.html @@ -14,11 +14,11 @@
- +
@@ -24368,14 +24495,16 @@ var htmlAnchorDirective = valueFn({ element.append(document.createComment('IE fix')); } - return function(scope, element) { - element.on('click', function(event){ - // if we have no href url, then don't navigate anywhere. - if (!element.attr('href')) { - event.preventDefault(); - } - }); - }; + if (!attr.href && !attr.name) { + return function(scope, element) { + element.on('click', function(event){ + // if we have no href url, then don't navigate anywhere. + if (!element.attr('href')) { + event.preventDefault(); + } + }); + }; + } } }); @@ -24766,9 +24895,22 @@ var nullFormCtrl = { * @property {Object} $error Is an object hash, containing references to all invalid controls or * forms, where: * - * - keys are validation tokens (error names) — such as `required`, `url` or `email`, - * - values are arrays of controls or forms that are invalid with given error. + * - keys are validation tokens (error names), + * - values are arrays of controls or forms that are invalid for given error name. * + * + * Built-in validation tokens: + * + * - `email` + * - `max` + * - `maxlength` + * - `min` + * - `minlength` + * - `number` + * - `pattern` + * - `required` + * - `url` + * * @description * `FormController` keeps track of all its controls and nested forms as well as state of them, * such as being valid/invalid or dirty/pristine. @@ -25560,15 +25702,15 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { deferListener(); }); - // if user paste into input using mouse, we need "change" event to catch it - element.on('change', listener); - // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it if ($sniffer.hasEvent('paste')) { element.on('paste cut', deferListener); } } + // if user paste into input using mouse on older browser + // or form autocomplete on newer browser, we need "change" event to catch it + element.on('change', listener); ctrl.$render = function() { element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue); @@ -26062,39 +26204,6 @@ var VALID_CLASS = 'ng-valid', * * - * ## Isolated Scope Pitfall - * - * Note that if you have a directive with an isolated scope, you cannot require `ngModel` - * since the model value will be looked up on the isolated scope rather than the outer scope. - * When the directive updates the model value, calling `ngModel.$setViewValue()` the property - * on the outer scope will not be updated. However you can get around this by using $parent. - * - * Here is an example of this situation. You'll notice that the first div is not updating the input. - * However the second div can update the input properly. - * - * - - angular.module('badIsolatedDirective', []).directive('isolate', function() { - return { - require: 'ngModel', - scope: { }, - template: '', - link: function(scope, element, attrs, ngModel) { - scope.$watch('innerModel', function(value) { - console.log(value); - ngModel.$setViewValue(value); - }); - } - }; - }); - - - -
-
-
- *
- * * */ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', @@ -26241,7 +26350,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ * It will update the $viewValue, then pass this value through each of the functions in `$parsers`, * which includes any validators. The value that comes out of this `$parsers` pipeline, be applied to * `$modelValue` and the **expression** specified in the `ng-model` attribute. - * + * * Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called. * * Note that calling this function does not trigger a `$digest`. @@ -26298,6 +26407,8 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ ctrl.$render(); } } + + return value; }); }]; @@ -26574,7 +26685,6 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; id="{{name}}" name="favorite"> -
You chose {{my.favorite}}
@@ -27791,9 +27901,12 @@ var ngIfDirective = ['$animate', function($animate) { if (!childScope) { childScope = $scope.$new(); $transclude(childScope, function (clone) { + clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' '); + // Note: We only need the first/last node of the cloned nodes. + // However, we need to keep the reference to the jqlite wrapper as it might be changed later + // by a directive with templateUrl when it's template arrives. block = { - startNode: clone[0], - endNode: clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' ') + clone: clone }; $animate.enter(clone, $element.parent(), $element); }); @@ -27806,7 +27919,7 @@ var ngIfDirective = ['$animate', function($animate) { } if (block) { - $animate.leave(getBlockElements(block)); + $animate.leave(getBlockElements(block.clone)); block = null; } } @@ -27962,13 +28075,14 @@ var ngIfDirective = ['$animate', function($animate) { * @description * Emitted every time the ngInclude content is reloaded. */ -var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile', '$animate', '$sce', - function($http, $templateCache, $anchorScroll, $compile, $animate, $sce) { +var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$animate', '$sce', + function($http, $templateCache, $anchorScroll, $animate, $sce) { return { restrict: 'ECA', priority: 400, terminal: true, transclude: 'element', + controller: angular.noop, compile: function(element, attr) { var srcExp = attr.ngInclude || attr.src, onloadExp = attr.onload || '', @@ -28002,6 +28116,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile' $http.get(src, {cache: $templateCache}).success(function(response) { if (thisChangeId !== changeCounter) return; var newScope = scope.$new(); + ctrl.template = response; // Note: This will also link all children of ng-include that were contained in the original // html. If that content contains controllers, ... they could pollute/change the scope. @@ -28009,15 +28124,14 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile' // Note: We can't remove them in the cloneAttchFn of $transclude as that // function is called before linking the content, which would apply child // directives to non existing elements. - var clone = $transclude(newScope, noop); - cleanupLastIncludeContent(); + var clone = $transclude(newScope, function(clone) { + cleanupLastIncludeContent(); + $animate.enter(clone, null, $element, afterAnimation); + }); currentScope = newScope; currentElement = clone; - currentElement.html(response); - $animate.enter(currentElement, null, $element, afterAnimation); - $compile(currentElement.contents())(currentScope); currentScope.$emit('$includeContentLoaded'); scope.$eval(onloadExp); }).error(function() { @@ -28026,6 +28140,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile' scope.$emit('$includeContentRequested'); } else { cleanupLastIncludeContent(); + ctrl.template = null; } }); }; @@ -28033,6 +28148,24 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile' }; }]; +// This directive is called during the $transclude call of the first `ngInclude` directive. +// It will replace and compile the content of the element with the loaded template. +// We need this directive so that the element content is already filled when +// the link function of another directive on the same element as ngInclude +// is called. +var ngIncludeFillContentDirective = ['$compile', + function($compile) { + return { + restrict: 'ECA', + priority: -400, + require: 'ngInclude', + link: function(scope, $element, $attr, ctrl) { + $element.html(ctrl.template); + $compile($element.contents())(scope); + } + }; + }]; + /** * @ngdoc directive * @name ng.directive:ngInit @@ -28049,6 +28182,8 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile' * to initialize values on a scope. * * + * @priority 450 + * * @element ANY * @param {expression} ngInit {@link guide/expression Expression} to eval. * @@ -28080,6 +28215,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile' */ var ngInitDirective = ngDirective({ + priority: 450, compile: function() { return { pre: function(scope, element, attrs) { @@ -28637,7 +28773,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { } else if (nextBlockMap.hasOwnProperty(trackById)) { // restore lastBlockMap forEach(nextBlockOrder, function(block) { - if (block && block.startNode) lastBlockMap[block.id] = block; + if (block && block.scope) lastBlockMap[block.id] = block; }); // This is a duplicate and we need to throw an error throw ngRepeatMinErr('dupes', "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}", @@ -28654,7 +28790,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { // lastBlockMap is our own object so we don't need to use special hasOwnPropertyFn if (lastBlockMap.hasOwnProperty(key)) { block = lastBlockMap[key]; - elementsToRemove = getBlockElements(block); + elementsToRemove = getBlockElements(block.clone); $animate.leave(elementsToRemove); forEach(elementsToRemove, function(element) { element[NG_REMOVED] = true; }); block.scope.$destroy(); @@ -28666,9 +28802,9 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { key = (collection === collectionKeys) ? index : collectionKeys[index]; value = collection[key]; block = nextBlockOrder[index]; - if (nextBlockOrder[index - 1]) previousNode = nextBlockOrder[index - 1].endNode; + if (nextBlockOrder[index - 1]) previousNode = getBlockEnd(nextBlockOrder[index - 1]); - if (block.startNode) { + if (block.scope) { // if we have already seen this object, then we need to reuse the // associated scope/element childScope = block.scope; @@ -28678,11 +28814,11 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { nextNode = nextNode.nextSibling; } while(nextNode && nextNode[NG_REMOVED]); - if (block.startNode != nextNode) { + if (getBlockStart(block) != nextNode) { // existing item which got moved - $animate.move(getBlockElements(block), null, jqLite(previousNode)); + $animate.move(getBlockElements(block.clone), null, jqLite(previousNode)); } - previousNode = block.endNode; + previousNode = getBlockEnd(block); } else { // new item which we don't know about childScope = $scope.$new(); @@ -28698,14 +28834,16 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { childScope.$odd = !(childScope.$even = (index&1) === 0); // jshint bitwise: true - if (!block.startNode) { + if (!block.scope) { $transclude(childScope, function(clone) { clone[clone.length++] = document.createComment(' end ngRepeat: ' + expression + ' '); $animate.enter(clone, null, jqLite(previousNode)); previousNode = clone; block.scope = childScope; - block.startNode = previousNode && previousNode.endNode ? previousNode.endNode : clone[0]; - block.endNode = clone[clone.length - 1]; + // Note: We only need the first/last node of the cloned nodes. + // However, we need to keep the reference to the jqlite wrapper as it might be changed later + // by a directive with templateUrl when it's template arrives. + block.clone = clone; nextBlockMap[block.id] = block; }); } @@ -28714,6 +28852,14 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { }); } }; + + function getBlockStart(block) { + return block.clone[0]; + } + + function getBlockEnd(block) { + return block.clone[block.clone.length - 1]; + } }]; /** @@ -29066,19 +29212,26 @@ var ngStyleDirective = ngDirective(function(scope, element, attr) { * @restrict EA * * @description - * The ngSwitch directive is used to conditionally swap DOM structure on your template based on a scope expression. - * Elements within ngSwitch but without ngSwitchWhen or ngSwitchDefault directives will be preserved at the location + * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression. + * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location * as specified in the template. * * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it - * from the template cache), ngSwitch simply choses one of the nested elements and makes it visible based on which element + * from the template cache), `ngSwitch` simply choses one of the nested elements and makes it visible based on which element * matches the value obtained from the evaluated expression. In other words, you define a container element - * (where you place the directive), place an expression on the **on="..." attribute** - * (or the **ng-switch="..." attribute**), define any inner elements inside of the directive and place + * (where you place the directive), place an expression on the **`on="..."` attribute** + * (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default * attribute is displayed. * + *
+ * Be aware that the attribute values to match against cannot be expressions. They are interpreted + * as literal string values to match against. + * For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the + * value of the expression `$scope.someVal`. + *
+ * @animations * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM @@ -29090,6 +29243,7 @@ var ngStyleDirective = ngDirective(function(scope, element, attr) { * ... * * + * * @scope * @priority 800 * @param {*} ngSwitch|on expression to match against ng-switch-when. @@ -29307,7 +29461,7 @@ var ngTranscludeDirective = ngDirective({ link: function($scope, $element, $attrs, controller) { controller.$transclude(function(clone) { - $element.html(''); + $element.empty(); $element.append(clone); }); } @@ -29691,13 +29845,13 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) { // becomes the compilation root nullOption.removeClass('ng-scope'); - // we need to remove it before calling selectElement.html('') because otherwise IE will + // we need to remove it before calling selectElement.empty() because otherwise IE will // remove the label from the element. wtf? nullOption.remove(); } // clear contents, we'll add what's needed based on the model - selectElement.html(''); + selectElement.empty(); selectElement.on('change', function() { scope.$apply(function() { From 63c5927a450fce224e50c83f0efa5571d821eacb Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 5 Mar 2011 20:26:40 -0800 Subject: [PATCH 02/15] step-0 bootstrap angular app - add ngApp directive to bootstrap the app - add simple template with an expression --- app/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/index.html b/app/index.html index 66698631f..88054e14e 100644 --- a/app/index.html +++ b/app/index.html @@ -1,5 +1,5 @@ - + My HTML File @@ -8,5 +8,8 @@ + +

Nothing here {{'yet' + '!'}}

+ From 603c4fad247e9f1764fe9198745276ae0c029693 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 5 Mar 2011 20:34:55 -0800 Subject: [PATCH 03/15] step-1 static phone list - Added static html list with two phones into index.html --- app/css/app.css | 5 +++++ app/index.html | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 8d3eae692..e8d83bcb5 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1 +1,6 @@ /* app css stylesheet */ + +body { + padding-top: 20px; +} + diff --git a/app/index.html b/app/index.html index 88054e14e..3d9848e88 100644 --- a/app/index.html +++ b/app/index.html @@ -2,14 +2,27 @@ - My HTML File + Google Phone Gallery -

Nothing here {{'yet' + '!'}}

+
    +
  • + Nexus S +

    + Fast just got faster with Nexus S. +

    +
  • +
  • + Motorola XOOM™ with Wi-Fi +

    + The Next, Next Generation tablet. +

    +
  • +
From 88e67293e688f0f3b84e0e905bf951ea7249e098 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 5 Mar 2011 21:03:53 -0800 Subject: [PATCH 04/15] step-2 angular template with repeater - Converted the static html list into dynamic one by: - creating PhoneListCtrl controller for the application - extracting the data from HTML into a the controller as an in-memory dataset - converting the static document into a template with the use of `[ngRepeat]` [directive] which iterates over the dataset with phones, clones the ngRepeat template for each instance and renders it into the view - Added a simple unit test to show off how to write tests and run them with JsTD (see README.md for instructions) --- app/index.html | 19 ++++++------------- app/js/controllers.js | 13 +++++++++++++ test/unit/controllersSpec.js | 13 ++++++++++++- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/app/index.html b/app/index.html index 3d9848e88..a92b6d24f 100644 --- a/app/index.html +++ b/app/index.html @@ -1,26 +1,19 @@ - + Google Phone Gallery + - +
    -
  • - Nexus S -

    - Fast just got faster with Nexus S. -

    -
  • -
  • - Motorola XOOM™ with Wi-Fi -

    - The Next, Next Generation tablet. -

    +
  • + {{phone.name}} +

    {{phone.snippet}}

diff --git a/app/js/controllers.js b/app/js/controllers.js index d314a3331..aa7ffe086 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -1,3 +1,16 @@ 'use strict'; /* Controllers */ + +var phonecatApp = angular.module('phonecatApp', []); + +phonecatApp.controller('PhoneListCtrl', function($scope) { + $scope.phones = [ + {'name': 'Nexus S', + 'snippet': 'Fast just got faster with Nexus S.'}, + {'name': 'Motorola XOOM™ with Wi-Fi', + 'snippet': 'The Next, Next Generation tablet.'}, + {'name': 'MOTOROLA XOOM™', + 'snippet': 'The Next, Next Generation tablet.'} + ]; +}); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index 37fd9fe45..9e1257c1b 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -1,7 +1,18 @@ 'use strict'; /* jasmine specs for controllers go here */ +describe('PhoneCat controllers', function() { -describe('controllers', function() { + describe('PhoneListCtrl', function(){ + beforeEach(module('phonecatApp')); + + it('should create "phones" model with 3 phones', inject(function($controller) { + var scope = {}, + ctrl = $controller('PhoneListCtrl', {$scope:scope}); + + expect(scope.phones.length).toBe(3); + })); + + }); }); From cb82c47d35b10c75c2ca023ea9c5689dab458cbc Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 5 Mar 2011 22:17:18 -0800 Subject: [PATCH 05/15] step-3 interactive search - Added a search box to demonstrate how: - the data-binding works on input fields - to use [filter] filter - [ngRepeat] automatically shrinks and grows the number of phones in the view - Added an end-to-end test to: - show how end-to-end tests are written and used - to prove that the search box and the repeater are correctly wired together --- app/index.html | 27 +++++++++++++++++++++------ test/e2e/scenarios.js | 21 +++++++++++++++++---- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/app/index.html b/app/index.html index a92b6d24f..6d15e8682 100644 --- a/app/index.html +++ b/app/index.html @@ -10,12 +10,27 @@ -
    -
  • - {{phone.name}} -

    {{phone.snippet}}

    -
  • -
+
+
+
+ + + Search: + +
+
+ + +
    +
  • + {{phone.name}} +

    {{phone.snippet}}

    +
  • +
+ +
+
+
diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index a59d2f688..7733141b7 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -2,10 +2,23 @@ /* http://docs.angularjs.org/guide/dev_guide.e2e-testing */ -describe('my app', function() { +describe('PhoneCat App', function() { + + describe('Phone list view', function() { + + beforeEach(function() { + browser().navigateTo('app/index.html'); + }); - beforeEach(function() { - browser().navigateTo('app/index.html'); - }); + it('should filter the phone list as user types into the search box', function() { + expect(repeater('.phones li').count()).toBe(3); + + input('query').enter('nexus'); + expect(repeater('.phones li').count()).toBe(1); + + input('query').enter('motorola'); + expect(repeater('.phones li').count()).toBe(2); + }); + }); }); From 776ee3e918e8246be9c090ff3e8c71ae6c2393b1 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sun, 6 Mar 2011 00:40:40 -0800 Subject: [PATCH 06/15] step-4 phone ordering - Add "age" property to the phone model - Add select box to control phone list order - Override the default order value in controller - Add unit and e2e test for this feature --- app/index.html | 7 ++++++- app/js/controllers.js | 11 ++++++++--- test/e2e/scenarios.js | 15 +++++++++++++++ test/unit/controllersSpec.js | 13 ++++++++----- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/app/index.html b/app/index.html index 6d15e8682..86ac4c663 100644 --- a/app/index.html +++ b/app/index.html @@ -16,13 +16,18 @@ Search: + Sort by: +
    -
  • +
  • {{phone.name}}

    {{phone.snippet}}

  • diff --git a/app/js/controllers.js b/app/js/controllers.js index aa7ffe086..8af52cd09 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -7,10 +7,15 @@ var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller('PhoneListCtrl', function($scope) { $scope.phones = [ {'name': 'Nexus S', - 'snippet': 'Fast just got faster with Nexus S.'}, + 'snippet': 'Fast just got faster with Nexus S.', + 'age': 1}, {'name': 'Motorola XOOM™ with Wi-Fi', - 'snippet': 'The Next, Next Generation tablet.'}, + 'snippet': 'The Next, Next Generation tablet.', + 'age': 2}, {'name': 'MOTOROLA XOOM™', - 'snippet': 'The Next, Next Generation tablet.'} + 'snippet': 'The Next, Next Generation tablet.', + 'age': 3} ]; + + $scope.orderProp = 'age'; }); diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index 7733141b7..d84ba05d4 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -20,5 +20,20 @@ describe('PhoneCat App', function() { input('query').enter('motorola'); expect(repeater('.phones li').count()).toBe(2); }); + + + it('should be possible to control phone order via the drop down select box', function() { + input('query').enter('tablet'); //let's narrow the dataset to make the test assertions shorter + + expect(repeater('.phones li', 'Phone List').column('phone.name')). + toEqual(["Motorola XOOM\u2122 with Wi-Fi", + "MOTOROLA XOOM\u2122"]); + + select('orderProp').option('Alphabetical'); + + expect(repeater('.phones li', 'Phone List').column('phone.name')). + toEqual(["MOTOROLA XOOM\u2122", + "Motorola XOOM\u2122 with Wi-Fi"]); + }); }); }); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index 9e1257c1b..76cd497c9 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -4,15 +4,18 @@ describe('PhoneCat controllers', function() { describe('PhoneListCtrl', function(){ + var scope, ctrl; beforeEach(module('phonecatApp')); - it('should create "phones" model with 3 phones', inject(function($controller) { - var scope = {}, - ctrl = $controller('PhoneListCtrl', {$scope:scope}); - - expect(scope.phones.length).toBe(3); + beforeEach(inject(function($controller) { + scope = {}; + ctrl = $controller('PhoneListCtrl', {$scope:scope}); })); + + it('should set the default value of orderProp model', function() { + expect(scope.orderProp).toBe('age'); + }); }); }); From edffc05ace6561116e67b2e719364c25dd7a6041 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 5 Mar 2011 22:42:31 -0800 Subject: [PATCH 07/15] step-5 XHR and dependency injection - Replaced the in-memory dataset with data loaded from the server (in the form of static phone.json file to make this tutorial backend agnostic) - The json file is loaded using the [$http] service - Demonstrate the use of [services][service] and [dependency injection][DI] - The [$http] is injected into the controller through [dependency injection][DI] --- app/js/controllers.js | 16 ++++------------ test/e2e/scenarios.js | 4 ++-- test/unit/controllersSpec.js | 20 ++++++++++++++++---- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 8af52cd09..69d5c7d2f 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -4,18 +4,10 @@ var phonecatApp = angular.module('phonecatApp', []); -phonecatApp.controller('PhoneListCtrl', function($scope) { - $scope.phones = [ - {'name': 'Nexus S', - 'snippet': 'Fast just got faster with Nexus S.', - 'age': 1}, - {'name': 'Motorola XOOM™ with Wi-Fi', - 'snippet': 'The Next, Next Generation tablet.', - 'age': 2}, - {'name': 'MOTOROLA XOOM™', - 'snippet': 'The Next, Next Generation tablet.', - 'age': 3} - ]; +phonecatApp.controller('PhoneListCtrl', function($scope, $http) { + $http.get('phones/phones.json').success(function(data) { + $scope.phones = data; + }); $scope.orderProp = 'age'; }); diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index d84ba05d4..cbaad45ae 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -12,13 +12,13 @@ describe('PhoneCat App', function() { it('should filter the phone list as user types into the search box', function() { - expect(repeater('.phones li').count()).toBe(3); + expect(repeater('.phones li').count()).toBe(20); input('query').enter('nexus'); expect(repeater('.phones li').count()).toBe(1); input('query').enter('motorola'); - expect(repeater('.phones li').count()).toBe(2); + expect(repeater('.phones li').count()).toBe(8); }); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index 76cd497c9..2e4e78028 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -4,16 +4,28 @@ describe('PhoneCat controllers', function() { describe('PhoneListCtrl', function(){ - var scope, ctrl; + var scope, ctrl, $httpBackend; beforeEach(module('phonecatApp')); + beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) { + $httpBackend = _$httpBackend_; + $httpBackend.expectGET('phones/phones.json'). + respond([{name: 'Nexus S'}, {name: 'Motorola DROID'}]); - beforeEach(inject(function($controller) { - scope = {}; - ctrl = $controller('PhoneListCtrl', {$scope:scope}); + scope = $rootScope.$new(); + ctrl = $controller('PhoneListCtrl', {$scope: scope}); })); + it('should create "phones" model with 2 phones fetched from xhr', function() { + expect(scope.phones).toBeUndefined(); + $httpBackend.flush(); + + expect(scope.phones).toEqual([{name: 'Nexus S'}, + {name: 'Motorola DROID'}]); + }); + + it('should set the default value of orderProp model', function() { expect(scope.orderProp).toBe('age'); }); From 4a4236f8656c82634e459b1f4151a656c2c5d547 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 5 Mar 2011 23:46:55 -0800 Subject: [PATCH 08/15] step-6 phone images and links - adding phone image and links to phone pages - add end2end test that verifies our phone links - css to style the page just a notch --- app/css/app.css | 17 +++++++++++++++++ app/index.html | 5 +++-- test/e2e/scenarios.js | 7 +++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index e8d83bcb5..9408ed2b8 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -4,3 +4,20 @@ body { padding-top: 20px; } +.phones { + list-style: none; +} + +.thumb { + float: left; + margin: -1em 1em 1.5em 0em; + padding-bottom: 1em; + height: 100px; + width: 100px; +} + +.phones li { + clear: both; + height: 100px; + padding-top: 15px; +} diff --git a/app/index.html b/app/index.html index 86ac4c663..025b15425 100644 --- a/app/index.html +++ b/app/index.html @@ -27,8 +27,9 @@ diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index cbaad45ae..15f9be38c 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -35,5 +35,12 @@ describe('PhoneCat App', function() { toEqual(["MOTOROLA XOOM\u2122", "Motorola XOOM\u2122 with Wi-Fi"]); }); + + + it('should render phone specific links', function() { + input('query').enter('nexus'); + element('.phones li a').click(); + expect(browser().location().url()).toBe('/phones/nexus-s'); + }); }); }); From 58e9dd7074af1161de02145dde12199dab7730a9 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sun, 6 Mar 2011 16:26:30 -0800 Subject: [PATCH 09/15] step-7 $route and app partitioning - Introduce the [$route] service which allows binding URLs for deep-linking with views - Create PhoneCatCtrl which governs the entire app and contains $route configuration - Load the ngRoute module - Map `/phones' to PhoneListCtrl and partails/phones-list.html - Map `/phones/' to PhoneDetailCtrl and partails/phones-detail.html - Copy deep linking parameters to root controller `params` property for access in sub controllers - Replace content of index.html with [ngView] directive - Create phone list route - Preserve existing PhoneListCtrl controller - Move existing html from index.html to partials/phone-list.html - Create phone details route - Empty placeholder PhoneDetailsCtrl controller - Empty placeholder partials/phane-details.html template --- app/index.html | 32 ++++---------------------------- app/js/app.js | 21 +++++++++++++++++++++ app/js/controllers.js | 20 +++++++++++++------- app/partials/phone-detail.html | 1 + app/partials/phone-list.html | 27 +++++++++++++++++++++++++++ test/e2e/scenarios.js | 21 ++++++++++++++++++++- test/unit/controllersSpec.js | 4 ++++ 7 files changed, 90 insertions(+), 36 deletions(-) create mode 100644 app/partials/phone-detail.html create mode 100644 app/partials/phone-list.html diff --git a/app/index.html b/app/index.html index 025b15425..cf21d04e3 100644 --- a/app/index.html +++ b/app/index.html @@ -6,37 +6,13 @@ + + - + -
    -
    -
    - - - Search: - Sort by: - - -
    -
    - - - - -
    -
    -
    +
    diff --git a/app/js/app.js b/app/js/app.js index 7a8f274a0..7b24e7d4c 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -1,3 +1,24 @@ 'use strict'; /* App Module */ + +var phonecatApp = angular.module('phonecatApp', [ + 'ngRoute', + 'phonecatControllers' +]); + +phonecatApp.config(['$routeProvider', + function($routeProvider) { + $routeProvider. + when('/phones', { + templateUrl: 'partials/phone-list.html', + controller: 'PhoneListCtrl' + }). + when('/phones/:phoneId', { + templateUrl: 'partials/phone-detail.html', + controller: 'PhoneDetailCtrl' + }). + otherwise({ + redirectTo: '/phones' + }); + }]); diff --git a/app/js/controllers.js b/app/js/controllers.js index 69d5c7d2f..25b6ee972 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -2,12 +2,18 @@ /* Controllers */ -var phonecatApp = angular.module('phonecatApp', []); +var phonecatControllers = angular.module('phonecatControllers', []); -phonecatApp.controller('PhoneListCtrl', function($scope, $http) { - $http.get('phones/phones.json').success(function(data) { - $scope.phones = data; - }); +phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http', + function($scope, $http) { + $http.get('phones/phones.json').success(function(data) { + $scope.phones = data; + }); - $scope.orderProp = 'age'; -}); + $scope.orderProp = 'age'; + }]); + +phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', + function($scope, $routeParams) { + $scope.phoneId = $routeParams.phoneId; + }]); diff --git a/app/partials/phone-detail.html b/app/partials/phone-detail.html new file mode 100644 index 000000000..364ac7348 --- /dev/null +++ b/app/partials/phone-detail.html @@ -0,0 +1 @@ +TBD: detail view for {{phoneId}} diff --git a/app/partials/phone-list.html b/app/partials/phone-list.html new file mode 100644 index 000000000..1bc54f55e --- /dev/null +++ b/app/partials/phone-list.html @@ -0,0 +1,27 @@ +
    +
    +
    + + + Search: + Sort by: + + +
    +
    + + + + +
    +
    +
    diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index 15f9be38c..62b6ef973 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -4,10 +4,16 @@ describe('PhoneCat App', function() { + it('should redirect index.html to index.html#/phones', function() { + browser().navigateTo('app/index.html'); + expect(browser().location().url()).toBe('/phones'); + }); + + describe('Phone list view', function() { beforeEach(function() { - browser().navigateTo('app/index.html'); + browser().navigateTo('app/index.html#/phones'); }); @@ -43,4 +49,17 @@ describe('PhoneCat App', function() { expect(browser().location().url()).toBe('/phones/nexus-s'); }); }); + + + describe('Phone detail view', function() { + + beforeEach(function() { + browser().navigateTo('app/index.html#/phones/nexus-s'); + }); + + + it('should display placeholder page with phoneId', function() { + expect(binding('phoneId')).toBe('nexus-s'); + }); + }); }); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index 2e4e78028..a755e4a6e 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -30,4 +30,8 @@ describe('PhoneCat controllers', function() { expect(scope.orderProp).toBe('age'); }); }); + + + describe('PhoneDetailCtrl', function(){ + }); }); From 800909a6efb0434674d0749f75d7514acdaf5afe Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Sun, 6 Mar 2011 17:10:37 -0800 Subject: [PATCH 10/15] step-8 phone details view - Fetch data for and render phone detail view - PhoneDetailCtrl controller to fetch details json with [$xhr] for a specific phone - template for the phone detailed view - CSS to make the phone details page look "pretty" --- app/css/app.css | 56 ++++++++++++++++ app/js/controllers.js | 8 ++- app/partials/phone-detail.html | 114 ++++++++++++++++++++++++++++++++- test/e2e/scenarios.js | 4 +- test/unit/controllersSpec.js | 21 +++++- 5 files changed, 196 insertions(+), 7 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 9408ed2b8..6236d8bde 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -21,3 +21,59 @@ body { height: 100px; padding-top: 15px; } + +/** Detail View **/ +img.phone { + float: left; + border: 1px solid black; + margin-right: 3em; + margin-bottom: 2em; + background-color: white; + padding: 2em; + height: 400px; + width: 400px; +} + +ul.phone-thumbs { + margin: 0; + list-style: none; +} + +ul.phone-thumbs li { + border: 1px solid black; + display: inline-block; + margin: 1em; + background-color: white; +} + +ul.phone-thumbs img { + height: 100px; + width: 100px; + padding: 1em; +} + +ul.specs { + clear: both; + margin: 0; + padding: 0; + list-style: none; +} + +ul.specs > li{ + display: inline-block; + width: 200px; + vertical-align: top; +} + +ul.specs > li > span{ + font-weight: bold; + font-size: 1.2em; +} + +ul.specs dt { + font-weight: bold; +} + +h1 { + border-bottom: 1px solid gray; +} diff --git a/app/js/controllers.js b/app/js/controllers.js index 25b6ee972..2a51d20eb 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -13,7 +13,9 @@ phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http', $scope.orderProp = 'age'; }]); -phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', - function($scope, $routeParams) { - $scope.phoneId = $routeParams.phoneId; +phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', + function($scope, $routeParams, $http) { + $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) { + $scope.phone = data; + }); }]); diff --git a/app/partials/phone-detail.html b/app/partials/phone-detail.html index 364ac7348..900ffd84d 100644 --- a/app/partials/phone-detail.html +++ b/app/partials/phone-detail.html @@ -1 +1,113 @@ -TBD: detail view for {{phoneId}} + + +

    {{phone.name}}

    + +

    {{phone.description}}

    + +
      +
    • + +
    • +
    + +
      +
    • + Availability and Networks +
      +
      Availability
      +
      {{availability}}
      +
      +
    • +
    • + Battery +
      +
      Type
      +
      {{phone.battery.type}}
      +
      Talk Time
      +
      {{phone.battery.talkTime}}
      +
      Standby time (max)
      +
      {{phone.battery.standbyTime}}
      +
      +
    • +
    • + Storage and Memory +
      +
      RAM
      +
      {{phone.storage.ram}}
      +
      Internal Storage
      +
      {{phone.storage.flash}}
      +
      +
    • +
    • + Connectivity +
      +
      Network Support
      +
      {{phone.connectivity.cell}}
      +
      WiFi
      +
      {{phone.connectivity.wifi}}
      +
      Bluetooth
      +
      {{phone.connectivity.bluetooth}}
      +
      Infrared
      +
      {{phone.connectivity.infrared}}
      +
      GPS
      +
      {{phone.connectivity.gps}}
      +
      +
    • +
    • + Android +
      +
      OS Version
      +
      {{phone.android.os}}
      +
      UI
      +
      {{phone.android.ui}}
      +
      +
    • +
    • + Size and Weight +
      +
      Dimensions
      +
      {{dim}}
      +
      Weight
      +
      {{phone.sizeAndWeight.weight}}
      +
      +
    • +
    • + Display +
      +
      Screen size
      +
      {{phone.display.screenSize}}
      +
      Screen resolution
      +
      {{phone.display.screenResolution}}
      +
      Touch screen
      +
      {{phone.display.touchScreen}}
      +
      +
    • +
    • + Hardware +
      +
      CPU
      +
      {{phone.hardware.cpu}}
      +
      USB
      +
      {{phone.hardware.usb}}
      +
      Audio / headphone jack
      +
      {{phone.hardware.audioJack}}
      +
      FM Radio
      +
      {{phone.hardware.fmRadio}}
      +
      Accelerometer
      +
      {{phone.hardware.accelerometer}}
      +
      +
    • +
    • + Camera +
      +
      Primary
      +
      {{phone.camera.primary}}
      +
      Features
      +
      {{phone.camera.features.join(', ')}}
      +
      +
    • +
    • + Additional Features +
      {{phone.additionalFeatures}}
      +
    • +
    diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index 62b6ef973..2942bf383 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -58,8 +58,8 @@ describe('PhoneCat App', function() { }); - it('should display placeholder page with phoneId', function() { - expect(binding('phoneId')).toBe('nexus-s'); + it('should display nexus-s page', function() { + expect(binding('phone.name')).toBe('Nexus S'); }); }); }); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index a755e4a6e..f91d821e5 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -3,10 +3,11 @@ /* jasmine specs for controllers go here */ describe('PhoneCat controllers', function() { + beforeEach(module('phonecatApp')); + describe('PhoneListCtrl', function(){ var scope, ctrl, $httpBackend; - beforeEach(module('phonecatApp')); beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) { $httpBackend = _$httpBackend_; $httpBackend.expectGET('phones/phones.json'). @@ -33,5 +34,23 @@ describe('PhoneCat controllers', function() { describe('PhoneDetailCtrl', function(){ + var scope, $httpBackend, ctrl; + + beforeEach(inject(function(_$httpBackend_, $rootScope, $routeParams, $controller) { + $httpBackend = _$httpBackend_; + $httpBackend.expectGET('phones/xyz.json').respond({name:'phone xyz'}); + + $routeParams.phoneId = 'xyz'; + scope = $rootScope.$new(); + ctrl = $controller('PhoneDetailCtrl', {$scope: scope}); + })); + + + it('should fetch phone detail', function() { + expect(scope.phone).toBeUndefined(); + $httpBackend.flush(); + + expect(scope.phone).toEqual({name:'phone xyz'}); + }); }); }); From 9077fdc1af846ebdf35694b8a5647c1c6191a54e Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 19 Apr 2011 10:54:44 -0700 Subject: [PATCH 11/15] step-9 checkmark filter - Added custom checkmark filter - Update phone detail template to use checkmark filter - Added spec for the filter --- app/index.html | 1 + app/js/app.js | 3 ++- app/js/filters.js | 6 ++++++ app/partials/phone-detail.html | 10 +++++----- test/unit/filtersSpec.js | 11 +++++++++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/app/index.html b/app/index.html index cf21d04e3..4ef526d52 100644 --- a/app/index.html +++ b/app/index.html @@ -9,6 +9,7 @@ + diff --git a/app/js/app.js b/app/js/app.js index 7b24e7d4c..7238d2166 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -4,7 +4,8 @@ var phonecatApp = angular.module('phonecatApp', [ 'ngRoute', - 'phonecatControllers' + 'phonecatControllers', + 'phonecatFilters' ]); phonecatApp.config(['$routeProvider', diff --git a/app/js/filters.js b/app/js/filters.js index 85e8440f8..4f62309ba 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -1,3 +1,9 @@ 'use strict'; /* Filters */ + +angular.module('phonecatFilters', []).filter('checkmark', function() { + return function(input) { + return input ? '\u2713' : '\u2718'; + }; +}); diff --git a/app/partials/phone-detail.html b/app/partials/phone-detail.html index 900ffd84d..310441cf2 100644 --- a/app/partials/phone-detail.html +++ b/app/partials/phone-detail.html @@ -48,9 +48,9 @@

    {{phone.name}}

    Bluetooth
    {{phone.connectivity.bluetooth}}
    Infrared
    -
    {{phone.connectivity.infrared}}
    +
    {{phone.connectivity.infrared | checkmark}}
    GPS
    -
    {{phone.connectivity.gps}}
    +
    {{phone.connectivity.gps | checkmark}}
  • @@ -79,7 +79,7 @@

    {{phone.name}}

    Screen resolution
    {{phone.display.screenResolution}}
    Touch screen
    -
    {{phone.display.touchScreen}}
    +
    {{phone.display.touchScreen | checkmark}}
  • @@ -92,9 +92,9 @@

    {{phone.name}}

    Audio / headphone jack
    {{phone.hardware.audioJack}}
    FM Radio
    -
    {{phone.hardware.fmRadio}}
    +
    {{phone.hardware.fmRadio | checkmark}}
    Accelerometer
    -
    {{phone.hardware.accelerometer}}
    +
    {{phone.hardware.accelerometer | checkmark}}
  • diff --git a/test/unit/filtersSpec.js b/test/unit/filtersSpec.js index 5fdc76a26..e5cbb7262 100644 --- a/test/unit/filtersSpec.js +++ b/test/unit/filtersSpec.js @@ -4,4 +4,15 @@ describe('filter', function() { + beforeEach(module('phonecatFilters')); + + + describe('checkmark', function() { + + it('should convert boolean values to unicode checkmark or cross', + inject(function(checkmarkFilter) { + expect(checkmarkFilter(true)).toBe('\u2713'); + expect(checkmarkFilter(false)).toBe('\u2718'); + })); + }); }); From 310e573939032a78487c9a3f9d3c445b93b82c81 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 21 Apr 2011 08:38:17 -0700 Subject: [PATCH 12/15] step-10 image swapping with ng:click In the phone detail view, clicking on a thumbnail image, changes the main phone image to be the large version of the thumbnail image. - Define mainImageUrl model variable in the PhoneDetailCtrl and set its default value - Create setImage controller method to change mainImageUrl - Register ng:click handler for thumb images to use setImage controller method - Add e2e tests for this feature - Add css to change the mouse cursor when user points at thumnail images --- app/css/app.css | 5 +++++ app/js/controllers.js | 5 +++++ app/partials/phone-detail.html | 4 ++-- test/e2e/scenarios.js | 14 ++++++++++++++ test/unit/controllersSpec.js | 13 ++++++++++--- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 6236d8bde..ae060289a 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -52,6 +52,11 @@ ul.phone-thumbs img { padding: 1em; } +ul.phone-thumbs img:hover { + cursor: pointer; +} + + ul.specs { clear: both; margin: 0; diff --git a/app/js/controllers.js b/app/js/controllers.js index 2a51d20eb..3fa461372 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -17,5 +17,10 @@ phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$h function($scope, $routeParams, $http) { $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) { $scope.phone = data; + $scope.mainImageUrl = data.images[0]; }); + + $scope.setImage = function(imageUrl) { + $scope.mainImageUrl = imageUrl; + } }]); diff --git a/app/partials/phone-detail.html b/app/partials/phone-detail.html index 310441cf2..5785e94ca 100644 --- a/app/partials/phone-detail.html +++ b/app/partials/phone-detail.html @@ -1,4 +1,4 @@ - +

    {{phone.name}}

    @@ -6,7 +6,7 @@

    {{phone.name}}

    • - +
    diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index 2942bf383..9863ae6bb 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -61,5 +61,19 @@ describe('PhoneCat App', function() { it('should display nexus-s page', function() { expect(binding('phone.name')).toBe('Nexus S'); }); + + + it('should display the first phone image as the main phone image', function() { + expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg'); + }); + + + it('should swap main image if a thumbnail image is clicked on', function() { + element('.phone-thumbs li:nth-child(3) img').click(); + expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.2.jpg'); + + element('.phone-thumbs li:nth-child(1) img').click(); + expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg'); + }); }); }); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index f91d821e5..904dea344 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -34,11 +34,18 @@ describe('PhoneCat controllers', function() { describe('PhoneDetailCtrl', function(){ - var scope, $httpBackend, ctrl; + var scope, $httpBackend, ctrl, + xyzPhoneData = function() { + return { + name: 'phone xyz', + images: ['image/url1.png', 'image/url2.png'] + } + }; + beforeEach(inject(function(_$httpBackend_, $rootScope, $routeParams, $controller) { $httpBackend = _$httpBackend_; - $httpBackend.expectGET('phones/xyz.json').respond({name:'phone xyz'}); + $httpBackend.expectGET('phones/xyz.json').respond(xyzPhoneData()); $routeParams.phoneId = 'xyz'; scope = $rootScope.$new(); @@ -50,7 +57,7 @@ describe('PhoneCat controllers', function() { expect(scope.phone).toBeUndefined(); $httpBackend.flush(); - expect(scope.phone).toEqual({name:'phone xyz'}); + expect(scope.phone).toEqual(xyzPhoneData()); }); }); }); From b3ea9d96e57a32a2a4de9ae4ea1f259ab6407cd9 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sun, 6 Mar 2011 18:15:07 -0800 Subject: [PATCH 13/15] step-11 custom service and $resource - Replaced [$xhr] with [$resource] - Created a custom Phone service that represents the $resource client --- app/index.html | 2 ++ app/js/app.js | 3 ++- app/js/controllers.js | 18 +++++++----------- app/js/services.js | 8 ++++++++ test/unit/controllersSpec.js | 19 ++++++++++++++----- 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/app/index.html b/app/index.html index 4ef526d52..5933f7c94 100644 --- a/app/index.html +++ b/app/index.html @@ -6,10 +6,12 @@ + + diff --git a/app/js/app.js b/app/js/app.js index 7238d2166..7103787cc 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -5,7 +5,8 @@ var phonecatApp = angular.module('phonecatApp', [ 'ngRoute', 'phonecatControllers', - 'phonecatFilters' + 'phonecatFilters', + 'phonecatServices' ]); phonecatApp.config(['$routeProvider', diff --git a/app/js/controllers.js b/app/js/controllers.js index 3fa461372..c8ecfbba1 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -4,20 +4,16 @@ var phonecatControllers = angular.module('phonecatControllers', []); -phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http', - function($scope, $http) { - $http.get('phones/phones.json').success(function(data) { - $scope.phones = data; - }); - +phonecatControllers.controller('PhoneListCtrl', ['$scope', 'Phone', + function($scope, Phone) { + $scope.phones = Phone.query(); $scope.orderProp = 'age'; }]); -phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', - function($scope, $routeParams, $http) { - $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) { - $scope.phone = data; - $scope.mainImageUrl = data.images[0]; +phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', 'Phone', + function($scope, $routeParams, Phone) { + $scope.phone = Phone.get({phoneId: $routeParams.phoneId}, function(phone) { + $scope.mainImageUrl = phone.images[0]; }); $scope.setImage = function(imageUrl) { diff --git a/app/js/services.js b/app/js/services.js index 8207480df..e0b81a8ac 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -2,3 +2,11 @@ /* Services */ +var phonecatServices = angular.module('phonecatServices', ['ngResource']); + +phonecatServices.factory('Phone', ['$resource', + function($resource){ + return $resource('phones/:phoneId.json', {}, { + query: {method:'GET', params:{phoneId:'phones'}, isArray:true} + }); + }]); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index 904dea344..e85cc111a 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -3,7 +3,16 @@ /* jasmine specs for controllers go here */ describe('PhoneCat controllers', function() { + beforeEach(function(){ + this.addMatchers({ + toEqualData: function(expected) { + return angular.equals(this.actual, expected); + } + }); + }); + beforeEach(module('phonecatApp')); + beforeEach(module('phonecatServices')); describe('PhoneListCtrl', function(){ var scope, ctrl, $httpBackend; @@ -19,11 +28,11 @@ describe('PhoneCat controllers', function() { it('should create "phones" model with 2 phones fetched from xhr', function() { - expect(scope.phones).toBeUndefined(); + expect(scope.phones).toEqualData([]); $httpBackend.flush(); - expect(scope.phones).toEqual([{name: 'Nexus S'}, - {name: 'Motorola DROID'}]); + expect(scope.phones).toEqualData( + [{name: 'Nexus S'}, {name: 'Motorola DROID'}]); }); @@ -54,10 +63,10 @@ describe('PhoneCat controllers', function() { it('should fetch phone detail', function() { - expect(scope.phone).toBeUndefined(); + expect(scope.phone).toEqualData({}); $httpBackend.flush(); - expect(scope.phone).toEqual(xyzPhoneData()); + expect(scope.phone).toEqualData(xyzPhoneData()); }); }); }); From 17c7f0f2b3b8643fe7255c16e9d8841995238c39 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Tue, 8 Oct 2013 18:13:12 +0100 Subject: [PATCH 14/15] step-12 animations --- app/css/animations.css | 97 ++++++++++++++++++++++++++++++++++ app/css/app.css | 10 +++- app/index.html | 10 +++- app/js/animations.js | 52 ++++++++++++++++++ app/js/app.js | 2 + app/partials/phone-detail.html | 7 ++- app/partials/phone-list.html | 3 +- test/e2e/scenarios.js | 6 +-- 8 files changed, 180 insertions(+), 7 deletions(-) create mode 100644 app/css/animations.css create mode 100644 app/js/animations.js diff --git a/app/css/animations.css b/app/css/animations.css new file mode 100644 index 000000000..46f3da6ec --- /dev/null +++ b/app/css/animations.css @@ -0,0 +1,97 @@ +/* + * animations css stylesheet + */ + +/* animate ngRepeat in phone listing */ + +.phone-listing.ng-enter, +.phone-listing.ng-leave, +.phone-listing.ng-move { + -webkit-transition: 0.5s linear all; + -moz-transition: 0.5s linear all; + -o-transition: 0.5s linear all; + transition: 0.5s linear all; +} + +.phone-listing.ng-enter, +.phone-listing.ng-move { + opacity: 0; + height: 0; + overflow: hidden; +} + +.phone-listing.ng-move.ng-move-active, +.phone-listing.ng-enter.ng-enter-active { + opacity: 1; + height: 120px; +} + +.phone-listing.ng-leave { + opacity: 1; + overflow: hidden; +} + +.phone-listing.ng-leave.ng-leave-active { + opacity: 0; + height: 0; + padding-top: 0; + padding-bottom: 0; +} + +/* cross fading between routes with ngView */ + +.view-container { + position: relative; +} + +.view-frame.ng-enter, +.view-frame.ng-leave { + background: white; + position: absolute; + top: 0; + left: 0; + right: 0; +} + +.view-frame.ng-enter { + -webkit-animation: 0.5s fade-in; + -moz-animation: 0.5s fade-in; + -o-animation: 0.5s fade-in; + animation: 0.5s fade-in; + z-index: 100; +} + +.view-frame.ng-leave { + -webkit-animation: 0.5s fade-out; + -moz-animation: 0.5s fade-out; + -o-animation: 0.5s fade-out; + animation: 0.5s fade-out; + z-index: 99; +} + +@keyframes fade-in { + from { opacity: 0; } + to { opacity: 1; } +} +@-moz-keyframes fade-in { + from { opacity: 0; } + to { opacity: 1; } +} +@-webkit-keyframes fade-in { + from { opacity: 0; } + to { opacity: 1; } +} + +@keyframes fade-out { + from { opacity: 1; } + to { opacity: 0; } +} +@-moz-keyframes fade-out { + from { opacity: 1; } + to { opacity: 0; } +} +@-webkit-keyframes fade-out { + from { opacity: 1; } + to { opacity: 0; } +} + diff --git a/app/css/app.css b/app/css/app.css index ae060289a..8e2ff4db1 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -4,6 +4,15 @@ body { padding-top: 20px; } + +.phone-images { + width: 450px; + height: 450px; + overflow: hidden; + position: relative; + float: left; +} + .phones { list-style: none; } @@ -25,7 +34,6 @@ body { /** Detail View **/ img.phone { float: left; - border: 1px solid black; margin-right: 3em; margin-bottom: 2em; background-color: white; diff --git a/app/index.html b/app/index.html index 5933f7c94..26e294f0e 100644 --- a/app/index.html +++ b/app/index.html @@ -5,17 +5,25 @@ Google Phone Gallery + + + + + + -
    +
    +
    +
    diff --git a/app/js/animations.js b/app/js/animations.js new file mode 100644 index 000000000..8f3404265 --- /dev/null +++ b/app/js/animations.js @@ -0,0 +1,52 @@ +var phonecatAnimations = angular.module('phonecatAnimations', ['ngAnimate']); + +phonecatAnimations.animation('.phone', function() { + + var animateUp = function(element, className, done) { + if(className != 'active') { + return; + } + element.css({ + position: 'absolute', + top: 500, + left: 0, + display: 'block' + }); + + jQuery(element).animate({ + top: 0 + }, done); + + return function(cancel) { + if(cancel) { + element.stop(); + } + }; + } + + var animateDown = function(element, className, done) { + if(className != 'active') { + return; + } + element.css({ + position: 'absolute', + left: 0, + top: 0 + }); + + jQuery(element).animate({ + top: -500 + }, done); + + return function(cancel) { + if(cancel) { + element.stop(); + } + }; + } + + return { + addClass: animateUp, + removeClass: animateDown + }; +}); diff --git a/app/js/app.js b/app/js/app.js index 7103787cc..a58955cd1 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -4,6 +4,8 @@ var phonecatApp = angular.module('phonecatApp', [ 'ngRoute', + 'phonecatAnimations', + 'phonecatControllers', 'phonecatFilters', 'phonecatServices' diff --git a/app/partials/phone-detail.html b/app/partials/phone-detail.html index 5785e94ca..5fc4da2ae 100644 --- a/app/partials/phone-detail.html +++ b/app/partials/phone-detail.html @@ -1,4 +1,9 @@ - +
    + +

    {{phone.name}}

    diff --git a/app/partials/phone-list.html b/app/partials/phone-list.html index 1bc54f55e..b7280249a 100644 --- a/app/partials/phone-list.html +++ b/app/partials/phone-list.html @@ -15,7 +15,8 @@
      -
    • +
    • {{phone.name}}

      {{phone.snippet}}

      diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index 9863ae6bb..f67a7a3db 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -64,16 +64,16 @@ describe('PhoneCat App', function() { it('should display the first phone image as the main phone image', function() { - expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg'); + expect(element('img.phone.active').attr('src')).toBe('img/phones/nexus-s.0.jpg'); }); it('should swap main image if a thumbnail image is clicked on', function() { element('.phone-thumbs li:nth-child(3) img').click(); - expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.2.jpg'); + expect(element('img.phone.active').attr('src')).toBe('img/phones/nexus-s.2.jpg'); element('.phone-thumbs li:nth-child(1) img').click(); - expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg'); + expect(element('img.phone.active').attr('src')).toBe('img/phones/nexus-s.0.jpg'); }); }); }); From b7d86e5a7e7cf8145e4b6ec52f5ee34b31eba714 Mon Sep 17 00:00:00 2001 From: John Wilson Date: Tue, 17 Dec 2013 10:23:14 +1000 Subject: [PATCH 15/15] Update README.md Some minor typographical/grammar fixes. Also fixed [$route] link reference. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b5e156459..cccac5f95 100644 --- a/README.md +++ b/README.md @@ -44,18 +44,18 @@ To see the changes which between any two lessons use the git diff command. ### step-1 - We have converted the seed application by removing all of the boiler-plate code. -- We have added single static HTML file which shows a static list of phones. (we will convert this - static page into dynamic one with the help of angular) +- We have added a single static HTML file which shows a static list of phones. We will convert this + static page into dynamic one with the help of angular. ### step-2 - Converted static page into dynamic one by: - - create a root controller for the application + - creating a root controller for the application - extracting the data from HTML into a the controller as a mock dataset - - convert the static document into a template with the use of `ng:` [directive] (iterate over + - converting the static document into a template with the use of `ng:` [directive] (iterate over mock data using [ng:repeat] and render it into a view) -- Added unit test, which mostly shows how one goes about writing a unit test, rather then test +- Added a unit test, which mostly shows how one goes about writing a unit test, rather than test something of value on our mock dataset. @@ -212,7 +212,7 @@ info. version.txt --> version file unit/ --> unit level specs/tests controllersSpec.js --> specs for controllers - directivessSpec.js --> specs for directives + directivesSpec.js --> specs for directives filtersSpec.js --> specs for filters servicesSpec.js --> specs for services @@ -234,6 +234,6 @@ For more information on AngularJS please check out http://angularjs.org/ [node-generic]: https://github.com/joyent/node/wiki/Installation [java]: http://www.java.com [$resource]: http://docs.angularjs.org/#!angular.service.$resource -[$rouet]: http://docs.angularjs.org/#!angular.service.$route +[$route]: http://docs.angularjs.org/#!angular.service.$route [service]: http://docs.angularjs.org/#!angular.service [$xhr]: http://docs.angularjs.org/#!angular.service.$xhr