template: `<div id="button-grup"></div>`,
class A {
[Inject]
public unit: IUnit;
constructor(){
}
}
class B {
public table: Table;
constructor(){
}
}
injector.inject(A).asInstence(Unit);
injector.inject(B).asSingleton(Table);
var store = new JSData.DS();
var adapter = new DSHttpAdapter({
serialize: function(resourceConfig, data){
console.log('adapter: serialize');
},
deserialize: function(resourceConfig, data){
console.log('adapter: deserialize');
}
});
store.registerAdapter('http', adapter, {default: true});
var User = store.defineResource({
name: 'user',
endpoint: 'users',
basePath: 'http://localhost:3000'
});
var user = User.createInstance({
id: 666,
firstName: "Bob",
lastName: "Bobert"
});
User.inject(user);
User.find(666).then(function(user){
return User.save(666);
});
router.options('/:id?', function(req, res, next){
console.log('[router Users][method OPTIONS]');
res.setHeader('Allow', 'PUT');
res.sendStatus(200);
res.end();
});
router.put('/:id?', function(req, res, next){
console.log('[router Users][method PUT]');
});
var express = require('express');
var router = express.Router();
var UserController = require('../controllers/user-controller');
router.get('/:id?', UserController.getUser);
router.post('/', UserController.createUser);
module.exports = router;
'/': app.use('/', роутер);