@{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>ngJquery</title> <script type="text/javascript" src="~/Scripts/jquery-1.10.2.js"></script> <script type="text/javascript" src="~/Scripts/angular.js"></script> </head> <body> <h1>Angular使用Jquery</h1> <div ng-app="myApp"> <div ng-controller="firstController"> <div ></div> {{name}} </div> <div ng-controller="secondController"> </div> <div ng-controller="threeController"> </div> </div> <script type="text/javascript"> var app = angular.module("myApp",[]); app.controller("firstController", function ($scope) { $scope.name = "张三"; // $("#obj1").html("<span>111111111111</span>"); var obj1 = document.getElementById("obj1"); angular.element(obj1).html("<span>这是AngularJS 内置的jqlite</span>");//不引入jq的情况下可以使用jqlite,但是功能比jq少。详情参考jqlite的文档 }); </script> </body> </html>
版权声明:除特别声明外,本站所有文章皆是本站原创,转载请以超链接形式注明出处!