Realization of picture Magnifier effect based on Angularjs _angularjs

Source: Internet
Author: User

Objective

Originally intended to be written with native Angularjs, but found that the original ANGULARJS, in any case, could not get the width and height of the inside image, because the Angularjs built-in jquery method is not winth() , the height() method.

Preferably, I've introduced jquery, with a width height on the same binding scope . Below the source code, by the way I will put some of the attention of the point to say.

Effect chart

First of all, explain

1, the first use of two peer instructions, and in two peer instructions to communicate between the same level of instruction communication, very simple, is not to let the same level of instruction generation independent scope , and in the same scope of the completion. If scope the instruction has no special declaration, then it is the parent scope . The template generated by the directive has no special meaning unless, by scope default, the directive does not create a new child, and, scope more often, a parent, that is scope , if the instruction exists controller under one, it is used controller scope .

2, then is used $q to delay the asynchronous acquisition of data, this can also look at $q the usage.

Source code Example

<! DOCTYPE html>  

Summarize

The above is the entire content of this article, do not know that we have learned it? Hope this article for everyone's study or work can bring some help, if there are questions welcome everyone to exchange messages.

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.