Quickstart
const { radis } = require('radis');
class Unicorn {
constructor(name) {
this.name = name;
}
poop() {
console.log(`${this.name} poop rainbow`);
}
}
class UnicornProvider {
constructor($injector, name) {
this.name = name;
}
setName(name) {
this.name = name;
}
$get() {
return new Unicorn(this.name);
}
}
radis
.module('app', [])
.provider('alice', UnicornProvider)
.provider('anonymousUnicorn', UnicornProvider)
.config((anonymousUnicornProvider) => anonymousUnicornProvider.setName("paul"))
.run((alice, anonymousUnicorn) => {
alice.poop();
anonymousUnicorn.poop();
})
.bootstrap()
;
Requirement
Radis use ES6 syntax internally so it require node >= 6.
Documentation
Go to documentation