ANGULARJS Study Notes

Source: Internet
Author: User

New project to use ANGULARJS, so take time to read a bit of information, by the way to remember


The Almighty Hello World

<!doctype html>


Module.js

var mymodule = angular.module ("Helloangular", []) Mymodule.controller ("Helloangular", [' $scope ', function Helloangular ($scope) {$scope. Greeting = {text: ' Hello '};}]);


Run effect

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/E4/wKioL1XAs6_TqnCcAAAP6Tl0MzM133.jpg "title=" 1.PNG " alt= "Wkiol1xas6_tqnccaaap6tl0mzm133.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M00/70/E7/ Wkiom1xaseujktflaaap6tl0mzm089.jpg "title=" 1.PNG "alt=" wkiom1xaseujktflaaap6tl0mzm089.jpg "/> page shows Hello, Angular

ANGULARJS directive

HTML page

<!doctype html>

JS Code

var mymodule = angular.module ("Helloangular", []) mymodule.directive ("Hello", function () {return{restrict: ' E ', Template: ' <div>hi everyone</div> ', Replace:true}});

Run Effect: page display Hi everyone

Bidirectional data binding

<!doctype html>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/E7/wKiom1XAtc3SOIg_AAAhi-4ax34874.jpg "title=" 2.PNG " alt= "Wkiom1xatc3soig_aaahi-4ax34874.jpg"/>







This article is from "Avatar" blog, please make sure to keep this source http://shamrock.blog.51cto.com/2079212/1681702

ANGULARJS Study Notes

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.