Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

44 lines
857 B
Plaintext

== Why is this an issue?
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.
=== Noncompliant code example
[source,javascript]
----
myCollection.models.forEach(function (model) { });
----
=== Compliant solution
[source,javascript]
----
myCollection.forEach(function (model) { });
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use "get|at" or the underscore methods instead.
'''
== Comments And Links
(visible only on this page)
=== on 20 May 2015, 12:32:24 Linda Martin wrote:
OK!
endif::env-github,rspecator-view[]