getByType
export class TasksComponent implements OnInit {
model: any = {};
type: any;
id: number;
constructor(
private taskService: TaskService,
private router: Router
) {}
ngOnInit() {
this.type = this.taskService.getByType(this.id).subscribe((type) => {
this.type = type;
});
}
}
"test:compile": "tsc -p tsconfig-test.json",
"test:full": "npm run test:compile && istanbul cover _mocha -- test-tmp/test/**/**.spec.js && npm run test:removeTestTmpDir",
"test:mocha": "npm run test:compile && mocha -- test-tmp/test/**/**.spec.js && npm run test:removeTestTmpDir",
"test:removeTestTmpDir": "rm -rf test-tmp",
"test": "npm run test:full",
public static isIdentifierNode (node: ITreeNode): node is IIdentifierNode {
return node.type === 'Identifier';
}
estraverse.replace(catchClauseNode.param, {
leave: (node: ITreeNode, parentNode: ITreeNode) => {
if (NodeUtils.isIdentifierNode(node)) {
this.catchClauseParam.set(node.name, Utils.getRandomVariableName());
node.name = this.catchClauseParam.get(node.name);
return;
}
return estraverse.VisitorOption.Skip;
}
});
declare let module: any;
function __extends(d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
module.exports = __extends;
resolve: {
modulesDirectories: ['node_modules', '.']
},.
plugins: [
new webpack.ProvidePlugin({
__extends: 'src/ts/ts-helpers/extends' //src/ts/ts-helpers/extens.ts
})
]
var webpack = require('laravel-elixir-webpack-ex');
mix.copy('node_modules/angular2/bundles/angular2-polyfills.js', 'public/js/angular2');
mix.webpack('app.ts', {
resolve: {
extensions: ['', '.js', '.ts']
},
module: {
loaders: [
{ test: /\.ts/, loader: 'ts-loader' }
]
}
}, 'public/js', 'resources/assets/typescript');
<script src="js/angular2/angular2-polyfills.js"></script>
<script src="js/app.js"></script>
return view('backend.content');
А дальше я не понимаю что нужно делать со скаченным файлом .d.ts
/// <reference path="jquery.d.ts"/>