model窗口弹出示例
一、html:
<div class="modal-header">
<h3 class="modal-title">提示</h3>
</div>
<div class="modal-body">{{message}}</div>
<div class="modal-footer">
<button class="btn btn-primary" data-ng-click="ok()">OK</button>
<button class="btn btn-warning" data-ng-click="cancel()">Cancel</button>
</div>
二、js 连式模块
/**
* modal模式窗口
*/
$messages.alert = function(info) {
var message = info['message'];//应用传递的message获取
var modalInstance = $modal.open({
templateUrl: urlManager.$staticViewUrls.$getUrl( 'static/html/platform/message/alert' ),//引用html模块
controller : ['$scope', '$modalInstance',function($scope, $modalInstance) {
$scope.message = message;//绑定到scope,html模块中会自动引用到
$scope.ok = function() {
$modalInstance.close();
}
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
}]//注意control写法,good
});
}
三、调用modal窗口应用:
messages.alert({
message : responseData['header']['message']
})