Angular UI $modal using option

Source: Internet
Author: User

$modalis a service that can quickly create modal windows, create partial pages, controllers, and associate them $modalThere is only one way open(options)
    • templateUrl: The address of the modal window
    • template:用于显示html标签
    • scope: A scope for modal content usage (in fact, $modal会创建一个当前作用域的子作用域 ) defaults to$rootScope
    • controller: Initializes the $scope for the $modal specified controller, which is available for $modalInstance injection
    • resolve: Defines a member and passes it to the controller specified by $modal, which is equivalent to a Reslove property of routes, and if a Objec object needs to be passed, use Angular.copy ()
    • backdrop: Control background, allowable value: True (default), False (no background)," static "-background is present, but modal window does not close when clicking outside modal window
    • keyboard: When ESC is pressed, the modal dialog box is closed and the default is Ture
    • windowClass: Specifies a class and is added to the modal window
The Open method returns a modal instance that has the following properties
    • close(result): Closes the modal window and passes a result
    • dismiss(reason): Undo modal method and pass a reason
    • result: A contract that is passed when the modal window is closed or revoked
    • opened: A contract that passes when the modal window is open and content is loaded

In addition, $modalInstance expands two methods, $close(result) which $dismiss(reason) are easy to close windows and do not require additional controllers

Html

 1 <!  DOCTYPE html> 2 

Angular UI $modal using option

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.