页面
电话量排行
应用
时间范围{{selected}}
查看范围
控制器
appCtrls.controller('chooseParamPhoneCallCtrl', function ($scope, $state, $stateParams, localStorageService, boardService) {
$scope.initPage=function(){
$scope.selected="";
}
$scope.backToPhoneCall = function () {
$state.go("tab.crm-viewCrmBoardPhoneCalls");
}
$scope.goToAddUser = function () {
var paramChoosePhoneCall = {term: $scope.selected};
console.debug("paramChoosePhoneCall-->>>" + angular.toJson(paramChoosePhoneCall));
//localStorageService.setLocalStorage("paramChoosePhoneCall",paramChoosePhoneCall);
}
})
如代码所示,页面加载之时初始化selected,然后将selected绑定到select,每次改变选择的内容{{selected}}中能正确显示改变后的内容,但是当点击查看范围下面的p触发goToAddUser后,在里面$scope.selected取到的不是选择后的内容,而是初始化之时赋得空值。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
后台
这样就好了
前台把值扔到方法里 就没问题了
controller中