angular多个控制器的使用
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