随笔分类 - AngularJS
摘要:ngPluralizeis a directive that displays messages according to en-US localization rules. Person 1: Person 2: Number of People: Without Offset: ...
阅读全文
摘要:Creating a Value ObjectSometimes you have javascript object defined: //value object var droidValue = { name: '', speak: function (...
阅读全文
摘要:Creating a Service:Before actual create an angular service, first create a constructor in Javascript: //constructor function function DroidServi...
阅读全文
摘要:// backend test beforeEach(inject(function (_$compile_, _$httpBackend_, _$rootScope_, _$state_, _AnnouncementsService_, _CONFIG_) { ...
阅读全文
摘要:angular.module('MyApplication', ['ngAnimate']) .controller('ApplicationController', ['$interval', function($interval) { var banner...
阅读全文
摘要:$stateProvider .state('landing', { url: '/', views: { 'body@': { ...
阅读全文
摘要:Refer:http://toddmotto.com/super-fast-angular-ng-model-options-limit-digest-cycles/Use:With Angular Formly:Refer:http://angular-formly.com/#/example/f...
阅读全文
摘要:ng-show:ng-show element will stay in dom, just added a ng-hide attr, so it won't show.ng-if:It has its own scope.Element is not display in the dom if ...
阅读全文
摘要:Nowdays, Single page apps are becoming increasingly popularamong the fornt-end developers. It is the time to say goodbye with refreshing the whole pag...
阅读全文
摘要:http://www.bennadel.com/blog/2935-enable-animations-explicitly-for-a-performance-boost-in-angularjs.htm?utm_campaign=NG-Newsletter&utm_medium=email&ut...
阅读全文
摘要:{{vm.userInfo.number}} - {{vm.userInfo.name}}'use strict';class CardTitleInformCtrl { constructor() { }}function CardTitleInformDirective() ...
阅读全文
摘要:http://social.technet.microsoft.com/wiki/contents/articles/32300.angularjs-unit-testing-using-karma-part-1.aspxTesting ControllerTesting $httpbackendT...
阅读全文
摘要:Read fromhttps://medium.com/@bluepnume/sane-scalable-angular-apps-are-tricky-but-not-impossible-lessons-learned-from-paypal-checkout-c5320558d4efng-Co...
阅读全文
摘要:Angular requires some careful consideration when uglifying your code because of how angular's dependency injection system works. See how easy it is to...
阅读全文
摘要:Using Angular with webpack makes the production build a breeze. Simply alter your webpack configuration at runtime based on an environment variable, a...
阅读全文
摘要:If u using controller & controllerAs in directive, then the link()'s 4th param 'controller' will refer to the controller u defined before. function Me...
阅读全文
摘要:Making your CSS modular is a difficult thing to do, but using Webpack makes this so much easier. By adding a single line to your Webpack config, you c...
阅读全文
摘要:With Angular, most of the time you're specifying a templateUrl for your directives and states/routes. This means you need to make sure that you're loa...
阅读全文
摘要:Install:npm install --save-dev babel-loaderwebpack.config.js:Add module, tell webpack to find all js file and use babel as loader, exclude all files i...
阅读全文
摘要:Since React is only interested in the V (view) of MVC, it plays well with other toolkits and frameworks. This includesAngularJSandD3.A app with React ...
阅读全文