1
我想知道如果我可以在Chrome控制台中运行anguar方法,因为angular方法不是一个globel对象,我不知道如何访问它。 如:我可以在Chrome控制台中运行角度法吗?
var app = angular.module('myApp',[]);
app.controller('MainController', function($scope){
$scope.say = function(){
alert('hello,world.')
}
})
见,我想访问$scope.say()
,任何想法?
它和下面一样吗?
var fn = function(){
function test(){
alert('123')
}
return {
abc: test
}
}
fn().abc(); // 123
fn().test(); // Uncaught TypeError: undefined is not a function
它的工作原理,我可以访问其他控制器的方法吗? –
只要您可以找到控制器内的元素,就可以。 – XrXrXr