A collection of small problems in the development of Angularjs a single object array element in a new controller cannot be bound

Source: Internet
Author: User

Angular version: 1.2.26


<div class="checkbox col-md-12 {{m.state ? ‘selected‘ : ‘‘}}" ng-repeat="m in ksType| filter:keyWords"> 
    <label>
        <input type="checkbox" ng-model="m" ng-checked="m.state" value="" ng-change="chooseCheck(m)">{{m.MC}}
    </label>
</div>

The above code (ng-mode= "M") binding failure, the flip wall on Google search for most of the day, there is a foreigner explained that the angular kernel design errors, in the new controller loop array elements can not be bound, as if the new version has been resolved, However, if you are under 2.0 can also be resolved, the solution is to define a new attribute within the "M" object, the solution such as: m.state, binding success!!!

This article will be supplemented by a deeper understanding of the angular kernel later.

This article from the "Do not abandon do not give up" blog, please be sure to keep this source http://noultimate.blog.51cto.com/4194949/1637451

A collection of small problems in the development of Angularjs a single object array element in a new controller cannot be bound

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.