Created
February 5, 2015 14:48
-
-
Save vitaliy-bobrov/b908d3796e2edabc06ab to your computer and use it in GitHub Desktop.
Blogin App Routes Step 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { | |
// Bar with tabs. | |
$stateProvider.state('tab', { | |
url: '/tab', | |
abstract: true, | |
templateUrl: 'templates/tabs.html' | |
}) | |
// Categories list tab. | |
.state('tab.categories', { | |
url: '/categories', | |
views: { | |
'tab-categories': { | |
templateUrl: 'templates/tab-categories.html', | |
controller: 'CategoriesCtrl' | |
} | |
} | |
}) | |
// One category tab with it articles. | |
.state('tab.category', { | |
url: '/category/:catId', | |
views: { | |
'tab-categories': { | |
templateUrl: 'templates/category.html', | |
controller: 'CategoryCtrl' | |
} | |
} | |
}) | |
// Article details page with full post content. | |
.state('tab.category-article', { | |
url: '/category/article/:articleId', | |
views: { | |
'tab-categories': { | |
templateUrl: 'templates/article-detail.html', | |
controller: 'ArticleDetailCtrl' | |
} | |
} | |
}) | |
// All articles tab. | |
.state('tab.articles', { | |
url: '/articles', | |
views: { | |
'tab-articles': { | |
templateUrl: 'templates/tab-articles.html', | |
controller: 'ArticlesCtrl' | |
} | |
} | |
}) | |
// Article details page with full post content. | |
.state('tab.article-detail', { | |
url: '/articles/:articleId', | |
views: { | |
'tab-articles': { | |
templateUrl: 'templates/article-detail.html', | |
controller: 'ArticleDetailCtrl' | |
} | |
} | |
}); | |
// default state that shows all articles tab. | |
$urlRouterProvider.otherwise('/tab/articles'); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment