AngularJs pop-up modal box (model), angularjs Modal

Source: Internet
Author: User

AngularJs pop-up modal box (model), angularjs Modal

Recommended: AngularJS Modal Dialog Box

$ Modal is a service that allows you to quickly create modal windows, create partial pages, controllers, and associate them.

$ Modal has only one open (options) 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 a modal 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.

HTML

<! DOCTYPE html> 

The above section describes the relevant content of the AngularJs pop-up modal box (model) introduced by xiaobian. I hope it will help you!

Articles you may be interested in:
  • Angularjs client compresses image files and uploads instances
  • AngularJS + Node. js for online chat rooms
  • AngularJS and bootstrap are combined to achieve dynamic loading of pop-up prompt content
  • How to Use angularjs and ajax
  • Introduction to $ http service usage in AngularJS
  • Learn how to use AngularJS File Upload Control
  • AngularJS Modal Dialog Box

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.