0
は簡単な質問があり、Laravel-Angleベースのプロジェクトを取り上げ、ビューで使用されるすべてのディレクティブ、コンポーネントなどにコンストラクタでこの 'ngInject'が付いていることを確認しました。それが何を見つけるか?どのように機能するのですか?ところで、テンプレートはAngularjs 1.5.8 es6で書かれています。例:laravelAngularコンポーネント 'ngInject'
class AppHeaderController{
constructor($sce){
'ngInject';
this.$sce = $sce;
}
$onInit(){
//defer iframe loading
let url = 'https://ghbtns.com/github-btn.html?user=jadjoubran&repo=laravel5-angular-material-starter&type=star&count=true&size=large';
this.githubWidget = this.$sce.trustAsResourceUrl(url);
}
}
export const AppHeaderComponent = {
templateUrl: './views/app/components/app-header/app-header.component.html',
controller: AppHeaderController,
controllerAs: 'vm',
bindings: {}
}
https://github.com/olov/ng-annotate – estus
ありがとうございました!心から感謝する :) – MattJ