AngularJS $ modal pop-up box instance code, angularjsmodal
The following describes how $ modal has a method: open, which describes the attributes of this method:
TemplateUrl: Address of the modal window
Template: used to display html tags
Scope: A content with a scope of modal is used (in fact, $ modal creates a subscope of the current scope). The default value is $ rootScope.
Controller: Initialize $ scope for the controller specified by $ modal. The controller can be injected with $ modalInstance.
Resolve: defines a member and passes it to the Controller specified by $ modal, which is equivalent to a reslove attribute of routes. To pass an objec object, you need to use angular. copy ()
Backdrop: controls the background. Valid values: true (default), false (no background), and "static"-the background exists. However, when you click a button outside the modal window, the modal window is not closed.
Keyboard: whether the modal dialog box is closed when Esc is pressed. The default value is true.
WindowClass: specify a class and add it to the modal window.
The open method returns an instance with the following attributes:
Close (result): close the modal window and pass a result.
Dismiss (reason): undo the modal method and pass a reason
Result: a contract that is passed when the modal window is closed or revoked.
Opened: the variable that is passed when the modal window is opened and the content is loaded.
In addition, $ modalInstance extends two methods: $ close (result) and $ dismiss (reason). These methods can easily close the window without additional controllers.
<! DOCTYPE html>
The above is the example code of AngularJS $ modal pop-up box introduced by xiaobian. I hope it will help you. If you have any questions, please leave a message and I will reply to you in time. Thank you very much for your support for the help House website!