Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
.controller('CategoriesTopicCtrl', function($scope, $stateParams, Topic, Subscription) {
$scope.topic = Topic.get({topicId: $stateParams.topicId})
console.log($scope.topic._id)
$scope.subscriptionData = {
'token':JSON.parse(window.localStorage['user']).authentication_token
};
console.log($scope.subscriptionData)
$scope.newSubscription = function() {
var subscription = new Subscription($scope.subscriptionData);
subscription.$save();
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.