Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.postTopic = function(){
- var q = $q.defer();
- var top = topicService.post($scope.topicName, $scope.topicDescription)
- q.resolve(top);
- return q.promise;
- }
- $scope.createNewTopic = function() {
- if ($scope.topicName && $scope.topicDescription) {
- var tmp = $scope.postTopic();
- console.log('tmp' + tmp);
- tmp.then(function (data){
- console.log('taaa' + data);
- $scope.search(data, true);
- })
- }
- else {
- alert('Enter valid input');
- }
- $scope.topicName = "";
- $scope.topicDescription = " ";
- $scope.showTopicForm = false;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement