Question: Angular Create a service wrapper for the browser window, localstorage. The service should implement CRUD ( create read update delete ) actions. Requirements Implement a

Angular
Create a service wrapper for the browser window, localstorage. The service should implement CRUD (create read update delete) actions.
Requirements
Implement a Localstorageservice template and logic that contains following methods:
add, which:
accepts two parameters: key and value, of type string:
adds a new item to the localstorage under the given key, only if key doesn't exist already.
returns a Boolean value stating whether the new entry has been added (true) or not (false).
update, which:
accepts two parameters: key and value, of type string:
changes the value stored under the provided key:
returns a string representing the value that has been replaced with the update;
o. returns nu11 if the developer is trying to update a nonexistent value.
remove, which
accepts one parameter: key, of type string:
removes the value specified by the key from the
localstorage:
 Angular Create a service wrapper for the browser window, localstorage. The

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!