Service Portal Dynamically Add ng-click

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2017 08:42 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2017 08:46 AM
You won't be able to do it that way because the angular bind functionality will have already happened and won't trigger again after you add that HTML snippet. Since for the most part angular is meant to be declarative, I would recommend put your span in there in your template with an ng-if if you don't want to show it in certain cases. Or put the ng-click in all cases, but decide inside the ng-click function based on certain criteria whether you are going to run the functionality.
If you explain your use case, I may be able to suggest something more specific though.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2017 08:52 AM
Your explanation of binding makes complete sense. That was the answer I was looking for. Thank you.
I'm dynamically building a calendar. For each day that's put in, I'm want to allow the user to click the day and be able to edit.
All the code (html) is dynamically "stuffed" into the calDiv div in script.