1.angular.bind
var ' Boy ' }; var f = angular.bind (self, function (age) {alert [ This] ! ' )}); F (N);
2, Angular.bootstrap
var app = Angular.module (' demo ', []) . Controller (function($scope) { = ') welcome! ' ; }); Angular.bootstrap (document, [' demo ']);
3, Angular.copy
Use a angular.copy copy to point to a new address
4, Angular.element
Angular.element (document.getElementById (' ddd ')). addclass (' CCC ')
5, Angular.equal (PRAM1,PRAM2);
Angular.equal ("A", "a"); // trueconsole.log (angular.equals (true, 1)); // false cannot be strongly converted var a={a:111}; var b={a:111};console.log (Angular.equals (A, b)); // true
6, Angular.foreach (ARR,FN,[context])
Object traversal
var values = {name: ' Misko ', Gender: ' Male '}; var log = []; function (value, key) { + ': ' + value '); }); Console.log (log);
["Name:misko", "Gender:male"]
var values = {name: ' Misko ', Gender: ' Male '};
var log = []; function (value, key) { this. push (key + ': ' + value); },log); // ["Name:misko", "Gender:male"]
// Array Traversal var values = [N/a ]; var log = []; function (value, key) { + ': ' + value '); }); Console.log (log);
7, Angular.fromjson
var json = ' {' name ': ' liSi ', ' Password ': ' 321 '} '; var jsonarr = ' [{' name ': ' Zhangsan ', ' password ': ' 123 '},{' name ': ' liSi ', ' Password ': ' 321 '}] '; var obj = Angular.fromjson (JSON); Console.log (obj); var objarr = Angular.fromjson (jsonarr); Console.log (Objarr);
8, Angular.identity
function GetResult (FN, input) { return (fn | | angular.identity) (input);}; GetResult (functionreturn n * 2; }, +); // returnsGetResult (null, +); // returnsGetResult (undefined, +); // returns
9.
Angularjs English API Learning (demo included)