angularjs 怎么在刷新页面的时候重置输入框的数据

2025-05-07 18:57:25
推荐回答(1个)
回答1:

定义了一个页面
.state('test', {
url: '/test',
templateUrl: 'templates/test.html',
controller: 'testCtrl'
})
$state.go("test",{}, {reload: true});
.controller('testCtrl', function($scope,$state,$window) {
$scope.loadData= function() {
alert(123);
}
$scope.loadData();
})