下面这段代码:{{message}}/***CreatedbyGlacieron2015/7/19.message-controller-scope.js*/functionMessageController($scope){$scope.message="Thisisamodel.";}显示结果是{{message}};应该显示是Thisisamodel.为什么显示不成功了?
2 回答

料青山看我应如是
TA贡献1772条经验 获得超8个赞
孩子,你得angular对象都没有加载进去!!!angular.module("app",[]).controller("MessageController",function($scope){$scope.message="Thisisamodel.";});

30秒到达战场
TA贡献1828条经验 获得超6个赞
我想,问题可能出在 这句,你看看路径是不是对的如果angularJS能够引入,那么针对ng-app="app"是可以自己扫描运行的,那么{{message}}你看到的就不是{{message}}了,要么是'Thisisamodel.',要么就是空白一片,要么就是console的报错.
添加回答
举报
0/150
提交
取消