You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Make a fresh contextgenie.addContext('foo');// Add a wishgenie({magicWords: 'foo 1',context: 'foo',action: function(){alert('foo 1');}});// Remove the context, this deletes the context and wish, right?genie.removeContext('foo');// Add Context again with same namegenie.addContext('foo');// Check contents of "new" contextgenie.getWishesInContext('foo');
The "new" context after removing it has the item already in it.
I was expecting the second time creating a context of the same name for it to be empty.
The general scenario is using Angular UI routing's onEnter and onExit as I want to build a context for the page and add wishes to that context, based on resolved API data, but, remove that context when the user leaves the page.
I did investigate using the directive but I had similar issues of it not being removed from context when the page is destroyed.
I want to keep my "main" contexts clean of items on the specific page as this is a large system so technically the items cached could have been deleted by other people.
Any ideas?
The text was updated successfully, but these errors were encountered:
philjones88
changed the title
Adding a context with same not empty after being removed before
Adding a context with same name not empty after being removed before
Aug 20, 2015
I'll be honest, it's been awhile since I've used this library (but you're starting to light the fire for me to start working on it again). Removing the context a wish belongs to will not remove the wish (see the code).
If you want to do that, you could first call genie.deregisterWishesWithContext('foo').
Hi,
Given the scenario:
The "new" context after removing it has the item already in it.
I was expecting the second time creating a context of the same name for it to be empty.
The general scenario is using Angular UI routing's
onEnter
andonExit
as I want to build a context for the page and add wishes to that context, based on resolved API data, but, remove that context when the user leaves the page.I did investigate using the directive but I had similar issues of it not being removed from context when the page is destroyed.
I want to keep my "main" contexts clean of items on the specific page as this is a large system so technically the items cached could have been deleted by other people.
Any ideas?
The text was updated successfully, but these errors were encountered: