Model window popup example

Model window popup example

One, 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>

 

2. js connected module

/**

* modal mode window

*/

$messages.alert = function(info) {

var message = info['message'];//Get the message passed by the application

var modalInstance = $ modal.open (

       templateUrl: urlManager.$staticViewUrls.$getUrl( 'static/html/platform/message/alert' ),//引用html模块

       controller  : ['$scope', '$modalInstance',function($scope, $modalInstance) {

       $scope.message = message;//Bind to scope, it will be automatically referenced in html module

       $scope.ok = function() {

       $modalInstance.close();

       }

       $scope.cancel = function () {

       $modalInstance.dismiss('cancel');

       };

       }]//Pay attention to the writing method of control, good

    });

}

3. Call the modal window application:

messages.alert({

message : responseData['header']['message']

})

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327056304&siteId=291194637