随笔分类 - AngularJS
摘要:angular.module( "FlightDemo", [ "FlightServices" ]) .controller( "flightDashboard", FlighDashboard);(function (angular) { "use stric...
阅读全文
posted @ 2014-09-05 04:41
Zhentiw
摘要:Chaining multiple asynchronous (server-) callsImagine having a user id in you application. Now you want to load the details of the staff associated wi...
阅读全文
posted @ 2014-09-04 05:10
Zhentiw
摘要:Chaining promisesThe return value of the then function of the promise is again a promise.(That maybe why in chain promise we can skip new a defer prom...
阅读全文
posted @ 2014-09-04 05:05
Zhentiw
摘要:The deferred object has a property promise which represents the promise of this task. With this promise we can register an on success and an on failur...
阅读全文
posted @ 2014-09-04 04:57
Zhentiw
摘要:all(promises);Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.defer: 推迟做某事defer.promise....
阅读全文
posted @ 2014-09-03 17:05
Zhentiw
摘要:Egghead Videos Save First Last Phone {{contact.firstNam...
阅读全文
posted @ 2014-08-30 20:11
Zhentiw
摘要:Idea is set up javascript as an api, then just change html to control the behavor.var app = angular.module("app", ["ngAnimate"]);app.controller("AppCt...
阅读全文
posted @ 2014-08-28 16:57
Zhentiw
摘要:Egghead Videos Goodbye, fair notificationI'm too young to fade! :(.toggle { -webkit-transition: linear 0.75s; -mo...
阅读全文
posted @ 2014-08-28 02:19
Zhentiw
摘要:If you use 'ng-repeat-start' you also should have 'ng-repeat-end'.And the element tag for ng-repeat-start and ng-repeat-end should be sinblings. Eg...
阅读全文
posted @ 2014-08-27 02:18
Zhentiw
摘要:Egghead Videos var app = angular.module("app", []);app.directive('country', function(){ ...
阅读全文
posted @ 2014-08-27 01:42
Zhentiw
摘要:AngularJS 1.2.x Does Not Allow Duplicate Keys in RepeatersThis lesson was recorded using an older version of AngularJS. With AngularJS 1.2.x, there ar...
阅读全文
posted @ 2014-08-26 17:53
Zhentiw
摘要:If you change a route, basic there are four steps before you can see the final reuslt.1. on fire, for exmaple:$location.path("/new");In this step, the...
阅读全文
posted @ 2014-08-26 16:55
Zhentiw
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { templateUr...
阅读全文
posted @ 2014-08-26 03:46
Zhentiw
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { templateUr...
阅读全文
posted @ 2014-08-26 03:37
Zhentiw
摘要://In the previous example, we show write a promise in the config funciton,//But we can image if the logic get complex, the code would be ugly,//there ...
阅读全文
posted @ 2014-08-26 02:16
Zhentiw
摘要:Before we see how promise works in contrller. But in contrller it is not a good way to put promises.When you route the page, before the controller get...
阅读全文
posted @ 2014-08-26 01:56
Zhentiw
摘要:Deferred represents a task that will finish in the future. We can get a new deferred object by calling the defer() function on the $q service.Initiall...
阅读全文
posted @ 2014-08-25 22:08
Zhentiw
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { // file:///C:/Use...
阅读全文
posted @ 2014-08-25 17:21
Zhentiw
摘要:Functionail:When user type "password" in the input.The div will toggle class to alert-box alert./** * Created by Answer1215 on 8/23/2014. */var app = ...
阅读全文
posted @ 2014-08-25 17:06
Zhentiw
摘要:In directive, if setreplace: trueit will replace the directive element in html. Angular Scope & /** * Created by Answer1215 on 8...
阅读全文
posted @ 2014-08-25 16:40
Zhentiw