I am trying to test a directive ( you can see full details at: Unit testing angular directive - very stuck)
One of the things I am stuck on is finding out what scope.$new(true)
means. From what I can find out it looks like $new creates a new child scope, but what is the (true) part and does angular do this automaticly because its not in my code yet it is still being thrown as the error TypeError: 'undefined' is not a function (evaluating 'scope.$new(true)')
According to the docs, the boolean argument to Scope.$new
specifies whether or not the new scope is an isolate scope. Isolate scopes do not inherit properties from their parent scope.
Isolate scopes are most often encountered when creating a directive and specifying scope: {...}
in the options object. See Isolating the Scope of a Directive for more on that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With