javascript - angular.element($0).scope()返回undefined
ringa_lee
ringa_lee 2017-04-11 12:11:56
0
1
251

狠菜鸟的一个问题,勿喷^_^
我的代码是这样的,

<html >
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src = "js/angular.js"></script>
</head>
<body  ng-app = "myApp">

<p ng-controller="myCtrl" id = "p">
    <button ng-bind = "text.id" id = "btn"></button>
</p>
<script>
angular.module("myApp",[])
        .controller("myCtrl",["$scope",function($scope){
            $scope.text = {
                id:1,
                num:20
            };
        }]);



</script>
</body>
</html>

进行测试的时候,在控制台输出angular.element($0).scope().text的时候为什么会返回undefined。。。
跪求大神解答!!膜拜ing~

ringa_lee
ringa_lee

ringa_lee

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!