ㅇ template
main template
/sheepgrid/app/index.html
/sheepgrid/app/views/centers.html
nested view
/sheepgrid/app/views/layout/default.html
/sheepgrid/app/views/tab1/welcome.html
/sheepgrid/app/views/tab1/userTabs.html
ㅇ directive
<div class="container" ui-view/>
=> for main template
<div class="panel-body">
<ul data-ui-view="tabs"></ul>
<ul data-ui-view="view"></ul>
=> for nested view
</div>
ㅇ route
// default route
$stateProvider.state('default', {
templateUrl : '/views/layout/default.html',
controller : 'DefaultCtrl',
abstract : true
}).state('default.centers', {
templateUrl : './views/centers.html',
controller : 'CentersCtrl',
=> for main template
}).state("app", {
templateUrl : "/views/layout/default.html",
controller : "DefaultCtrl",
abstract : true,
url : ""
}).state("app.centers", {
url : "/centers",
views : {
"tabs@app" : {
templateUrl : './views/centers.html',
controller : 'CentersCtrl'
},
"view@app" : {
templateUrl : "/views/tab1/welcome.html"
}
}
});
=> for nested view
ㅇ calling link for toggle according to the state
<li><a ui-sref="app.centers" ng-show="$state.includes('default.regions') || $state.includes('app.regions')">Centers</a></li>
<li><a ui-sref='app.regions' ng-show="$state.includes('default.centers') || $state.includes('app.centers')">Regions</a></li>
https://github.com/doohee323/sheepgrid
main template
/sheepgrid/app/index.html
/sheepgrid/app/views/centers.html
nested view
/sheepgrid/app/views/layout/default.html
/sheepgrid/app/views/tab1/welcome.html
/sheepgrid/app/views/tab1/userTabs.html
ㅇ directive
<div class="container" ui-view/>
=> for main template
<div class="panel-body">
<ul data-ui-view="tabs"></ul>
<ul data-ui-view="view"></ul>
=> for nested view
</div>
ㅇ route
// default route
$stateProvider.state('default', {
templateUrl : '/views/layout/default.html',
controller : 'DefaultCtrl',
abstract : true
}).state('default.centers', {
templateUrl : './views/centers.html',
controller : 'CentersCtrl',
=> for main template
}).state("app", {
templateUrl : "/views/layout/default.html",
controller : "DefaultCtrl",
abstract : true,
url : ""
}).state("app.centers", {
url : "/centers",
views : {
"tabs@app" : {
templateUrl : './views/centers.html',
controller : 'CentersCtrl'
},
"view@app" : {
templateUrl : "/views/tab1/welcome.html"
}
}
});
=> for nested view
ㅇ calling link for toggle according to the state
<li><a ui-sref="app.centers" ng-show="$state.includes('default.regions') || $state.includes('app.regions')">Centers</a></li>
<li><a ui-sref='app.regions' ng-show="$state.includes('default.centers') || $state.includes('app.centers')">Regions</a></li>
https://github.com/doohee323/sheepgrid
Comments
Post a Comment