Best way of storing data and chaning objects depending on other objects


#1

Hi
Sorry for really bad topic name, but I just dont know how to formulate it properly. If you know a better description please let me know.

My app allows user to create notes which can have tags, and those tags are arranged into categories. The problem starts when I allow user to edit existing tags and categories - chaning their names and also colors of categories.

How should I connect data to make all those user changes at-the-same-time for all tags etc.
For exmaple user changes the color and name of category and this change affects all existing notes with attached tags of this category.

So far I am using LocalStorage with objects of key/array for tags/notes/categories, and services to provide getters and setters for those objects, which are then changed within controllers.
Also am I stroing it right? localStorage.setItem(‘TAGS’, JSON.stringify(TagsLocalStorage)) is it a good approach?
I am not using cordova plugin yet, just testing as web app with ionic serve.

Obviously I can think of some solution - but I am not sure if it is a good way to do that. So I asking to know what will be elegnat and professional way of doing that.