私はVMを使用しようとしています。しかし時々それは働いているが、時々そうではない。
<div ng-controller="ProfileCtrl as profile">
<div class="profile-box">
<h4 class="m-b-0">{{ profile.name }}</h4>
<p class="text-muted"> {{profile.username }}</p>
</div>
</div>
私のコントローラ:ここ
は私のコードです
angular.module('app')
.controller('profileCtrl', ['$scope', '$state', 'Profile', profileCtrl]);
function profileCtrl($scope, $state, Profile) {
const vm = this;
Profile.get((resp)=> {
vm.profile = resp.user;
});
}
は、どのように私はそれがvm
を使用する作業することができますか?
ありがとうございました。
名前を変更するのは何ですか? – zeroflagL