为了账号安全,请及时绑定邮箱和手机立即绑定

angular.element($0).scope()返回undefined

angular.element($0).scope()返回undefined

qq_花开花谢_0 2018-10-26 13:10:49
狠菜鸟的一个问题,勿喷^_^ 我的代码是这样的,<html ><head>    <meta charset="UTF-8">    <title>Title</title>    <script src = "js/angular.js"></script></head><body  ng-app = "myApp"><div ng-controller="myCtrl" id = "div">    <button ng-bind = "text.id" id = "btn"></button></div><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~
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1761 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号