This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
directives scope with optional attributes? #1131
Closed
Description
Hi
I have a directive with its own scope.
scope: {optionalAttribute: '='}
I want the attributes to be optional.
if (scope.optionalAttribute == null)
{
scope.optionalAttribute= 'unnamed';
}
http://jsfiddle.net/johnnayweiler/28fJP/
This gives me the 'Non-assignable model expression'error.
Why is that so and how to enable default values for those attributes(make them optional)?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels