Angular common directives and methods

Source: Internet
Author: User

ng-bind-html//Binding HTML

Ng-cinclude//Binding template

Angular.copy ()

Angular.extend (DST,SRC)//Copy all attributes of SRC to DST

vardebug =true, Logger={print:function(s) {returnDebug?s: '}; App.controller (' Controllerone ', [' $scope ',function($scope) {//mixin $scopeangular.extend ($scope, Logger); //define our $scopeAngular.extend ($scope, {myVar:1, log:function() { This. Print ( This. MyVar); }    });}]); App.controller (' Controllertwo ', [' $scope ',function($scope) {//mixin $scopeangular.extend ($scope, Logger); //define our $scopeAngular.extend ($scope, {myVar:2, log:function() { This. Print ( This. MyVar); }    });}]);
App.controller (' Thingcontroller ', [' $scope ',function($scope) {//Private    var_thingone =' One ', _thingtwo=' both '; //ModelsAngular.extend ($scope, {get Thingone () {return_thingone; }, set Thingone (value) {if(Value!== ' one ' && value!==' both ') {             Throw NewError (' Invalid value ' (' +value+ ') forThingone '); }, get Thingtwo () {return_thingtwo; }, set Thingtwo (value) {if(Value!== ' both ' && value!==' three ') {             Throw NewError (' Invalid value ' (' +value+ ') forThingtwo ');    }   }); //MethodsAngular.extend ($scope, {//in the HTML template, something like {{things}}get Things () {return_thingone + "+_thingtwo; }    });}]);

Angular common directives and methods

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.