我是新来的角的js大型Angular应用程序的项目结构?
我要创造我的项目结构,这样
这里的核心,试验不同的模块(NG-APP)
我配置一样这里
app.js angular.module( 'mainapp',[ 'mainapp.core', 'mainapp.test'])
core.app.js angular.module( 'mainapp.core',[])
test.app.js angular.module( 'mainapp.test',[])
在这里我gettiing问题,我的核心模块状态不能正常工作。我使用$ staeprovider(ui-views)进行路由。
例如
core.config.routes.js
angular.module('mainapp.core').config(function($stateProvider,
$urlRouterProvider) {
$stateProvider
.state('core', {
url: '/core',
templateUrl: 'modules/core/views/core.html',
})
.state('core.sidebar ', {
url: '^/sidebar ',
templateUrl: 'modules/core/views/core.sidebar .html'
})
});
test.config.routes.js
angular.module('mainapp.test').config(function($stateProvider,
$urlRouterProvider) {
$stateProvider
.state('core.sidebar .test', {
url: '^/test',
templateUrl: 'modules/core/views/test.html'
})
});
我的HTML页面
的index.html
<div ng-app="mainapp">
<div ui-view= ""></div>
</div>
core.html
` <div>
<h1>I am designing jeader Here. it goes on tp of page</h1>
<div ui-view></div>
</div>`
core.sidebar的.html
`<div>
<h2>It goes left side</h2>
<h1>I am designing sidebar Here</h1>
<div ui-view></div>
</div>`
,直到这工作的罚款。 heaser,代尔栏加载$状态下core.sidebar
在这里我得到的问题是”不工作 的test.html
<div>
<h1>I am designing middle content Here</h1>
</div>
请任何一个可以帮助我解决这个问题,建立更好的项目结构方法