页面中同时引用了两个js文件,一个是angularjs的control,一个是常规js
control:
javascript
var app = angular.module('app', []); app.controller('ctrl', function($scope) { $scope.aaa = 1; });
常规js:
javascript
(function() { $scope.aaa = 2; //有什么办法可以让这个实现? })();
自己google解决了,http://www.cnblogs.com/czcz1024/p/3808345.html,浪费资源了,sorry。
Make good use of Google search. This kind of problem you often encounter is usually found on StackOverflow
How to access the angular $scope variable in browser's console?;
The most rustic solution...window['scope']=$scope
Write the angular controller in the function expression that is executed immediately:
Then introduce it into regular js