mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-31 03:29:23 +01:00
Clean up article example
This commit is contained in:
@@ -37,10 +37,6 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
|
||||
|
||||
$scope.update = function() {
|
||||
var article = $scope.article;
|
||||
if (!article.updated) {
|
||||
article.updated = [];
|
||||
}
|
||||
article.updated.push(new Date().getTime());
|
||||
|
||||
article.$update(function() {
|
||||
$location.path('articles/' + article._id);
|
||||
@@ -50,16 +46,12 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
|
||||
};
|
||||
|
||||
$scope.find = function() {
|
||||
Articles.query(function(articles) {
|
||||
$scope.articles = articles;
|
||||
});
|
||||
$scope.articles = Articles.query();
|
||||
};
|
||||
|
||||
$scope.findOne = function() {
|
||||
Articles.get({
|
||||
$scope.article = Articles.get({
|
||||
articleId: $stateParams.articleId
|
||||
}, function(article) {
|
||||
$scope.article = article;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user