mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-08 15:37:11 +01:00
* fix(users): test for usernameOrEmail * Add comment to remind change for mongo replicaset connection * clean comment .. * Generic pageTitle concept * Revert "Generic pageTitle concept" This reverts commit ff00ec950f085ca3b6d1abb564eab1965ab0a56e. * align on meanjs state * fix atom beautify newline * align to mean indent * pageTitle directive automatic pageTitle directive fix loads add .. clean lodash dependencies clean code clean code & indent clean lodash * pageTitle directive automatic pageTitle directive fix loads add .. clean lodash dependencies clean code clean code & indent clean lodash
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
angular
|
|
.module('articles.routes')
|
|
.config(routeConfig);
|
|
|
|
routeConfig.$inject = ['$stateProvider'];
|
|
|
|
function routeConfig($stateProvider) {
|
|
$stateProvider
|
|
.state('articles', {
|
|
abstract: true,
|
|
url: '/articles',
|
|
template: '<ui-view/>'
|
|
})
|
|
.state('articles.list', {
|
|
url: '',
|
|
templateUrl: '/modules/articles/client/views/list-articles.client.view.html',
|
|
controller: 'ArticlesListController',
|
|
controllerAs: 'vm'
|
|
})
|
|
.state('articles.view', {
|
|
url: '/:articleId',
|
|
templateUrl: '/modules/articles/client/views/view-article.client.view.html',
|
|
controller: 'ArticlesController',
|
|
controllerAs: 'vm',
|
|
resolve: {
|
|
articleResolve: getArticle
|
|
},
|
|
data: {
|
|
pageTitle: '{{ articleResolve.title }}'
|
|
}
|
|
});
|
|
}
|
|
|
|
getArticle.$inject = ['$stateParams', 'ArticlesService'];
|
|
|
|
function getArticle($stateParams, ArticlesService) {
|
|
return ArticlesService.get({
|
|
articleId: $stateParams.articleId
|
|
}).$promise;
|
|
}
|
|
}());
|