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

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

<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

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!