27 lines
637 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
When using the Backbone.js framework, the array of models inside a collection, ``++collection.models++``, should not be accessed directly. Doing so bypasses the listeners set on the collection and could put your application in a bad state.
Instead, use ``++get++``, ``++at++`` or the underscore methods.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
myCollection.models.forEach(function (model) { });
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
myCollection.forEach(function (model) { });
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]