在这里,我正在使用 spring-boot+security 应用程序中的角度路由。当我使用 ui-sref 访问 $stateProvider 中定义的状态时,整个页面都会刷新。如何停止刷新并仅附加 url 并查看模板?
angularJS代码:
myApp.config(function($stateProvider, $urlRouterProvider) {
// $urlRouterProvider.otherwise('/');
$stateProvider
.state('hi', {
url: '/hi/:id',
reloadOnSearch : false,
views :{
"properties" : {
templateUrl: "views/properties.html",
controller : function($scope,$stateParams){
//alert("hi");
}
}
}
});
});
HTML 代码:
<div class="col-md-7" ui-sref="hi ({Id: 1})">
<h5 class="widget-title smaller" >{{id.name}}</h5>
</div>