unsubscribeTopic method is tied to a buttton, but when I click on this button I get following error message,
TypeError: $scope.subscription.unsubscribe is not a function
at a.$$childScopeClass.$$childScopeClass.$scope.unsubscribeTopic (app.js:51)
at angular.js:10847
at f (angular.js:19136)
at a.$$childScopeClass.$$childScopeClass.$eval (angular.js:12702)
at a.$$childScopeClass.$$childScopeClass.$apply (angular.js:12800)
at HTMLButtonElement.<anonymous> (angular.js:19141)
at HTMLButtonElement.dispatch (jquery-min.js:3)
at HTMLButtonElement.i (jquery-min.js:3)
(anonymous) @ angular.js:10072
(anonymous) @ angular.js:7364
$apply @ angular.js:12802
(anonymous) @ angular.js:19141
dispatch @ jquery-min.js:3
i @ jquery-min.js:3
TypeError: a.unsubscribe is not a function
at angular-wamp.min.js:1
at angular-wamp.min.js:1
at F (angular.js:11573)
at angular.js:11659
at k.$eval (angular.js:12702)
at k.$digest (angular.js:12514)
at a.$$childScopeClass.$$childScopeClass.$apply (angular.js:12806)
at HTMLButtonElement.<anonymous> (angular.js:19141)
at HTMLButtonElement.dispatch (jquery-min.js:3)
at HTMLButtonElement.i (jquery-min.js:3)
(anonymous) @ angular.js:10072
(anonymous) @ angular.js:7364
F @ angular.js:11576
(anonymous) @ angular.js:11659
$eval @ angular.js:12702
$digest @ angular.js:12514
$apply @ angular.js:12806
(anonymous) @ angular.js:19141
dispatch @ jquery-min.js:3
i @ jquery-min.js:3
angular.js:10072 $wamp error Object {type: "unsubscribe", arguments: Arguments[1], error: TypeError: a.unsubscribe is not a function
at http://localhost:8080/myapp/resources/js/an…}
I have following code in my app.js,
unsubscribeTopic method is tied to a buttton, but when I click on this button I get following error message,
am I doing something wrong?
EDIT
I tried with following code as well,
but then I get following error,