AngularJS (with Material) and data exchange between controllers - $rootScope, factory or service -
i'm new angularjs (currently using 1.6.5) , i'm trying figure out how split code 1 big controller couple small controllers exchange data between themselves.
in few words have logic register attendees, register contact person , credit card capture informations in 1 large controller (let's call registrationctrl) captured data 3 steps passed further json object. goal split big controller 3 separate. side note - attendees registration i'm using mddialog angularjs material.
i have done research , have found multiple ways using $rootscope or factory, or service.
for service scenario thought share access data between controllers db or rest api calls somewhere else not exchange captured data on local level between controllers.
$rootscope i'm using in mainctrl controller store data db have got via service.
as there 3 different ways handle desired functionality 1 should choose have used in efficient way (and work angularjs material)?
i'm kind of stuck on decision 1 way should go. suggestions helpful.
Comments
Post a Comment