作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 rootes.js 中
.state('main.mydata', {
url: '/my-data',
templateUrl: '/app/views/pages/my-data.html',
controller: 'mydataCtrl'
})
.controller('mydataCtrl', ['$scope', '$state', '$http', function($scope, $state, $http) {
console.log("Came to My Data")
}])
Error: angular.js?bundleVirtualPath=~%2fbundles%2fangular:13708 [$controller:ctrlfmt] Badly formed controller string ''. Must match `__name__ as __id__` or `__name__`.
http://errors.angularjs.org/1.5.7/$controller/ctrlfmt?p0=
at http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7eNaNbundles%fangular:68:12
at $controller (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:10199:17)
at setupControllers (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:9331:34)
at nodeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:9116:32)
at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8510:13)
at nodeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:9210:24)
at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8510:13)
at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8513:13)
at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8513:13)
at publicLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8390:30)
最佳答案
页内
my-data.html
<div ng-controller="">
..
</div>
Badly formed controller
关于angularjs - Controller :ctrlfmt Badly formed controller string '' . 必须匹配 `__name__ as __id__` 或 `__name__`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39633425/
在 rootes.js 中 .state('main.mydata', { url: '/my-data', templateUrl: '/app/views/pages/my-dat
我是一名优秀的程序员,十分优秀!