javascript - Angular and passing objects between controllers -


i in progress of making angularjs app c# web api.

i have controller , b.

in controller a, have list of objects, when click add (between 2 list items), controller b.

//add item $location.path("/controllerb") 

inside controller b prestented list of objects, when select, need selected item, appear in controller a's list, @ sepcified index.

my approach far:

localstorage: use localstorage store selected object, accessible controller a, need index, , if store in ls access controller b, im headed down path of bad decisions feel :d

so best guess far:

1. save index controller in local storage. (go b)

2. save selecteditem controller b in local storage. (go a)

3. push selecteditem index.

so please, point me in angular direction.

consider using angular service hold data, inject service in controller , controller b.

have @ topic:

what's correct way communicate between controllers in angularjs?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -