-2

你好,星期五我创建了一个新项目,我创建了一个新的演示页面

查看我在 plunker 中的编码,我已经在 plunker 中创建了所有代码

链接在这里

问题是我已经为 header.html 创建了一个演示页面检查

<a ui-sref="rohit-about">about</a>
<a ui-sref="home">home</a>

如果我点击关于而不是显示此错误

Error: Could not resolve 'rohit-about' from state 'index'
    at Object.transitionTo (angular-ui-router.js:3074)
    at Object.go (angular-ui-router.js:3007)
    at angular-ui-router.js:4057
    at angular.js:17105
    at completeOutstandingRequest (angular.js:5073)
    at angular.js:5335

你能看看我的代码并告诉我我的代码哪里写错了吗?

请帮我

4

1 回答 1

0

问题是 MAIN 应用程序模块的双重定义:.module('azadApp', [...])

第一个在app.js

// Code goes here

angular
    .module('azadApp', [
            // here type dependency
            'rohit.about',
            'rohit.usdk'
        ]);

第二个rohit-module/layout/js/module.js

// another file and/or another anonymous function
(function(){
 // using the function form of use-strict...
  'use strict';

  angular.module('azadApp', ['ui.router']);


})();

事实上,第二个定义正在扼杀第一个。所以没有'rohit.about'在末尾'azadaApp'。因为app.js中的定义被打了。只需删除第二个,或正确设置它...

于 2015-03-21T17:44:07.960 回答