gpt4 book ai didi

javascript - ASP.net 样板 - 范围

转载 作者:行者123 更新时间:2023-12-02 15:24:28 28 4
gpt4 key购买 nike

我的 JS 为:

(function () {
var controllerId = 'app.views.dashboard';
angular.module('app').controller(controllerId, [
'$scope', '$stateParams', function ($scope, $stateParams) {
var vm = this;
//About logic...
var param = $stateParams.dashboardName;
vm.dashboardName = param; // not working

console.log(param); //Works
$scope.dashboardName = param; // not working
}]);
})();

我的观点定义为:

div ng-controller="app.views.dashboard as vm">
<h1
Dashboard Detail {dashboardName}
</h1

我在让这个工作时遇到问题,有什么想法吗?我的状态参数似乎正确传递,但是该参数没有填充 Angular 标记。帮助:)

最佳答案

在您看来,您应该将dashboardName引用为{{vm.dashboardName}}

关于javascript - ASP.net 样板 - 范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33806641/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com