• AngularJs练习Demo11引入Jquery


     1 @{
     2     Layout = null;
     3 }
     4 
     5 <!DOCTYPE html>
     6 
     7 <html>
     8 <head>
     9     <meta name="viewport" content="width=device-width" />
    10     <title>ngJquery</title>
    11     <script type="text/javascript" src="~/Scripts/jquery-1.10.2.js"></script>
    12     <script type="text/javascript" src="~/Scripts/angular.js"></script>
    13 
    14 </head>
    15 <body>
    16     <h1>Angular使用Jquery</h1>
    17     <div ng-app="myApp">
    18         <div ng-controller="firstController">
    19             <div id="obj1"></div>
    20             {{name}}
    21         </div>
    22         <div ng-controller="secondController">
    23 
    24         </div>
    25         <div ng-controller="threeController">
    26 
    27         </div>
    28     </div>
    29 <script type="text/javascript">
    30     var app = angular.module("myApp",[]);
    31     app.controller("firstController", function ($scope) {
    32         $scope.name = "张三";
    33        // $("#obj1").html("<span>111111111111</span>");
    34 
    35         var obj1 = document.getElementById("obj1");
    36         angular.element(obj1).html("<span>这是AngularJS 内置的jqlite</span>");//不引入jq的情况下可以使用jqlite,但是功能比jq少。详情参考jqlite的文档
    37     });
    38 </script>
    39 </body>
    40 
    41 </html>
  • 相关阅读:
    1219 总结
    1206 冲刺三
    1130 冲刺2
    1128 主页面
    1123 冲刺3
    1121 冲刺2
    1118 冲刺1
    1117 新冲刺
    0622 软件工程总结
    0617 实验四 主存空间的分配和回收
  • 原文地址:https://www.cnblogs.com/sumg/p/5605360.html
Copyright © 2020-2023  润新知