Angular - 100
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Angular - 100相关的知识,希望对你有一定的参考价值。
练习1:{{greeting.text}}会根据input的值而改变
<!doctype html> <html lang="en" ng-app> <head> <meta charset="utf-8"> <title>Angular</title> </head> <body> <input type="text" ng-model = "greeting.text" /> <p>{{greeting.text}},angular</p> <script src="/bower_components/angular/angular.min.js" type="text/javascript" charset="utf-8"></script> </body> </html>
练习2:页面输出 Hi everyone!
<!doctype html> <html lang="en" ng-app = "MyModule"> <head> <meta charset="utf-8"> <title>Angular</title> </head> <body> <hello></hello> <script src="/bower_components/angular/angular.min.js" type="text/javascript" charset="utf-8"></script> <script> var myModule = angular.module("MyModule", []); myModule.directive("hello", function() { return { restrict: ‘E‘, template: ‘<div>Hi everyone!</div>‘, replace: true } }); </script> </body> </html>
以上是关于Angular - 100的主要内容,如果未能解决你的问题,请参考以下文章