Angularjs Pop-up modal box (model) _angularjs

Source: Internet
Author: User
Tags html tags

Recommended reading: Detailed Angularjs modal dialog box

$modal is a service that can quickly create modal windows, creating partial pages, controllers, and associating them.

$modal only one method open (options)

Templateurl: Address of modal window

Template: for displaying HTML tags

Scope: A scope is used for modal content (in fact, $modal creates a child scope for the current scope) defaults to $rootscope

Controller: Initializes the $scope for the controller specified for $modal, which can be injected with $modalinstance

Resolve: Define a member and pass him to the controller specified by $modal, which is equivalent to a reslove attribute of routes, and if you need to pass a Objec object, you need to use Angular.copy ()

Backdrop: Control background, allowed values: True (default), False (no background), "static"-the background is present, but the modal window does not close when you click outside the 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 (results): 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 is passed when the modal window is opened and the content is loaded

In addition, the $modalInstance extends two method $close (result), $dismiss (reason), which easily closes the window and does not require an additional controller

Html

<! DOCTYPE html>  

The above is a small series to introduce the Angularjs pop-up modal box (model) related content, I hope to help!

Related Article

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.