angular多个控制器的使用

it2022-05-09  25

js

var ngapp1 = angular.module("vtb01", []); var ngc_view_detail = function ($scope, $element) { $element.click(function () { alert(this); }); }; angular.element(document).ready(function () { angular.bootstrap($("#vtb01")[0], ["vtb01"]); });

  

html

//注,不需要 html ng-app <div id="vtb01"> <input type="button" ng-controller="ngc_view_detail" value=" 显示 " /> </div> <div id="vtb02"> <input type="button" ng-controller="ngc_view_detail" value=" 显示 " /> </div>

  

 

,一般需引用jquery,angular

转载于:https://www.cnblogs.com/ijunxiong/articles/8044347.html


最新回复(0)