J
J
jack3d2015-09-17 18:37:08
Angular
jack3d, 2015-09-17 18:37:08

How to extend another controller in Angularjs?

Hello. I have two absolutely identical controllers.
The only difference is vm.postStatus = 'ready' and vm.postStatus = 'live';
How do I do:

angular.extend(this, $controller('feedController', {$scope: $scope, vm: vm}));

In this case, the methods are predefined, but vm.postStatus with a string is not. Tell me what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question