Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

directives scope with optional attributes? #1131

Closed
johnnyelwailer opened this issue Jul 9, 2012 · 1 comment
Closed

directives scope with optional attributes? #1131

johnnyelwailer opened this issue Jul 9, 2012 · 1 comment

Comments

@johnnyelwailer
Copy link

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.

@pkozlowski-opensource
Copy link
Member

Closing as duplicate of #1435

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants