这可能听起来是newb,但我一直在关注这个tutorial的angularjs组件。angularjs 1.5组件依赖注入
我是新来的组件和如何注入常量Utils
或authService
像我这样的组件?
app.component('tlOverallHeader', {
bindings: {
data: '='
},
templateUrl: 'js/indexTimeline/components/tl_overallHeader/templates/tl_overallHeader.html',
controller: function() {
this.ms = 'tlOverallheader!'
}
})
谢谢!
在ES6需要将参数分配给本地变量的情况下添加 'class FranchisesController {$ state = {state} { this。$ state = $ state; } addFranchise(){ this。$ state.go('franquicias.agregar'); } }' – elporfirio
你从哪里找到这个?我无法在https://docs.angularjs.org/guide/component上的文档中找到它。干杯 –
@NickWhiu你可以在依赖注入部分找到它 - https://docs.angularjs.org/guide/di – Gondy