Hi,
I need to create a service returning the Class. With this Class I want to
instantiate objects and override the Class methods.
There are several examples and discussions about it but non of them works
in the way I would expect.
Example:
function MyCtrl($scope, MyObject) {
var obj1 = new MyObject();
//override some method:
MyObject.prototype.getText = function() {
return 'override';
}
$scope.text = obj1.getText();
}
But it does not work. The methods MyObject.prototype.getText get not
overriden
Working example:
http://plnkr.co/edit/6z3QQ9gOG4bYIib8sjIM?p=preview
Could you please point me what I'm doing wrong?
Bartek
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.