Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Enum in an angular2-template and *ngIf #8588

Closed
Katy91 opened this issue May 11, 2016 · 4 comments
Closed

Use Enum in an angular2-template and *ngIf #8588

Katy91 opened this issue May 11, 2016 · 4 comments

Comments

@Katy91
Copy link

Katy91 commented May 11, 2016

Hello,

I have a problem with using typescript enums in angular2 templates.

http://plnkr.co/edit/orQTAcYkySK3tU5wr1Me?p=preview

I hope the plunker works :)

The plunker example shows, that it is not possible to use enums with *ngIf or somethingelse in the angular2 template. But with the numeric value it works.
Is it possible to use the enum expression?

Thanks

@woppa684
Copy link

This is by design I think ... See #2885

@Katy91
Copy link
Author

Katy91 commented May 11, 2016

Oh wow it is the solution. Thanks for this tip.

Just one line more and it works :)

http://plnkr.co/edit/orQTAcYkySK3tU5wr1Me?p=preview

@Katy91 Katy91 closed this as completed May 11, 2016
@Klyner007
Copy link

Klyner007 commented May 17, 2017

I had to make sure that my enum was of type 'Export'. Thanks :)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
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

3 participants