Determine behaviour of createAll
if $scope
is null
#5418
Labels
awaiting triage
Needs triaging by team
createAll
if $scope
is null
#5418
What
We need to determine if the current behaviour of
createAll
is correct as it stands (and update the documentation) or if we need to change it to take into account the case in which$scope
isnull
.Why
Currently if
$scope
passed intocreateAll
isnull
becausetypeof null === 'object'
it will throw aTypeError
.The current behaviour of
createAll
is that if$scope
is falsy (not defined) then we set the scope ofcreateAll
to the document.This raises the question; should the behaviour of
createAll
when$scope
is falsy be the same as the behaviour ofcreateAll
when$scope
isnull
?There is a potential scenario when a user might want
createAll
to only execute on a specific$scope
if it is notnull
and then not have it be executed ondocument
if$scope
isnull
. It is not clear from the documentation what they should do in this specific scenario.If our intended behaviour is that
$scope
would default todocument
if$scope
isnull
and the user wouldn't want this to occur, we should probably add:to our documentation on creating components.
Otherwise if we want
createAll
to not execute if$scope
is undefined then we'd need to changecreateAll
to detect when$scope
isnull
.The text was updated successfully, but these errors were encountered: