Minhaj Hussain

Minhaj Hussain

  • NA
  • 86
  • 6.1k

Inheritence using $scope

Jan 18 2018 12:41 PM
Hi,
I want to ask that like javascript objects we can perform inheritance on objects.i.e.
 
var obj1=function()
{
this.name="" 
} ;
 obj1.prototype.getName=function()
{
return this.name ;
 
var obj2=function()
{
this.address=""
};
obj2.prototype.getAddress=function()
{
return this.address;
}
 obj2.prototype=obj1;
 
 //Similarly why cant i do this:
 $scope.prototype=obj1;

Answers (2)