首页 > 代码库 > Angular MVC

Angular MVC

angular.js 引入angular.js文件
<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <script src="http://www.mamicode.com/angular.js" ></script>    <title></title></head><body>  <div ng-app="myApp">    <div ng-controller="firstController">     {{firstName}}      {{lastName}}    </div>  </div>  <script type="text/javascript">     var app = angular.module("myApp",[]);    app.controller(‘firstController‘, function($scope){      $scope.firstName="张三";      $scope.lastName="李四";    })  </script></body></html>

  

Angular MVC