![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
angular-class
Advanced tools
An Angular service for creating classes with inheritance. Exposes the `Class` service.
An Angular service for creating classes with inheritance. Exposes the Class
service.
The Class service.
Defines a new Class.
The contructor method
Other class methods
The instance.
The current method on the first ancestor which has this method.
Any class method or property.
The functionality of the Class
service is best explained by some examples.
//Creates the 'MyModels' module, which requires the 'Class' module
angular.module('MyModels', ['Class'])
//The Animal ModelClass, uses the 'Class' service
.factory('Animal', function(Class){
return function(){
var Animal = Class.extend({
init: function(){
this.isAlive = true;
this.age = 0;
this.color = null;
},
canWalk: function(){
return this.isAlive;
},
canFly: function(){
return this.isAlive;
},
passYear: function(){
this.age++;
}
});
return Animal;
}
})
//The Hamster ModelClass, uses the 'Animal' ModelClass service
.factory('Hamster', function(Animal){
var Hamster = Animal.extend({
init: function(){
this._super();
this.color = 'brown';
},
canFly: function(){
return false;
},
passYear: function(){
this._super();
if(this.age > 2){
this.isAlive = false;
}
}
});
return Hamster;
});
// A controller, which uses both the ModelClasses
myApp.controller('MyController', function(Animal, Hamster){
var tweety = new Animal();
tweety.passYear();
tweety.passYear();
tweety.passYear();
//tweety instanceof Class === true
//tweety instanceof Animal === true
//tweety.canFly() === true
//tweety.isAlive === true
var knaagie = new Hamster();
knaagie.passYear();
knaagie.passYear();
//knaagie.isAlive === true
knaagie.passYear();
//knaagie.isAlive === false
//knaagie instanceof Class === true
//knaagie instanceof Animal === true
//knaagie instanceof Hamster === true
//knaagie.canFly() === false
});
bower install angular-class --save
or npm install angular-class --save
angular-class.min.js
Class
module as dependency.npm install
bower install
gulp test
FAQs
An Angular service for creating classes with inheritance. Exposes the `Class` service.
The npm package angular-class receives a total of 2 weekly downloads. As such, angular-class popularity was classified as not popular.
We found that angular-class demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.