Mini MVVM Framework Avalonjs Learning Tutorial 17, some configuration items for Avalon

Source: Internet
Author: User

This chapter mainly introduces the Avalon.config method, which is used to develop some more intimate functions.

In general, when we use ms-controller binding, we need to add a Ms-controller class name to prevent the curly braces from being exposed when the network speed is slow.

<! DOCTYPE html>

The

Double curly braces are also default for Python's well-known templates, and in order to prevent conflicts, we have the need to change the qualifiers. Then we can do this

<! DOCTYPE html>

<!– and –> generate a comment node so that users don't see a mess when the internet is slow. Of course this also has the risk that if the user has defined a lot of comments on the page, there can be confusing problems.

Let's look at a useful configuration item, Debug. Avalon By default is in the console to print no debug messages, on-line we do not want users to see them, you can turn them off.

Avalon.config ({debug:false})

Avalon has its own AMD loader, if you want to use Requirejs or SEAJS, then you have to disable your own loader, or as suggested in the first section, directly in the source to delete it all.

  Avalon.config ({loader:false})

In addition, Avalon has two hidden configuration items.

Maxrepeatsize is used to configure the pool size of the proxy nodes generated by the Ms-repeat loop binding in order to reuse these VM objects. The default is 100. The memory on the phone is more serious, you can adjust this threshold point less.

Avalon.config ({lmaxrepeatsize:40})

Dettachvmodels is the decision to add a $vmodels, $vmodel property on the This object bound by the event. Previously added by default, now is not added by default, this is due to CG recycling considerations. And under Ie6-8, adding the $vmodels property for an element does not know why it throws an exception. See Source:

$vmodels, $vmodel should be little known, let's not care about them. This configuration item will also be removed in 1.36.

Mini MVVM Framework Avalonjs Learning Tutorial 17, some configuration items for Avalon

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.