routing - Two separate angularJS apps on the same file system -
my routes this:
/create-company/index.html#/part-one /dashboard/index.html#/view1 /auth/
now create-company
app used , on branch dashboard
app used.
currently use seed project make app, config, logs, scripts & test folders
in home directory 1 app.
to add second app, should create 2 folders app1 & app2
each contain own app, config, logs, scripts & test folders
?
then can point /dashboard/
/app1/app
, point /create-company/
/app2/app
or better stick single angularjs app @ /app/
, point both /create-company/
, /dashboard/
same /app/
folder?
although there may use-cases having multiple, separated apps helpful and/or appropriate, description 2 'apps' describe appear different sub-sections of 1 larger app.
consider in usage, there overlapping components, such shared directives, templates, or services? if so, best avoid duplication.
in addition, there no restriction on loading same app on 2 different pages, different markup - controllers etc, lead different functionality.
for example following fine on different pages:
<body> <div ng-app="my-app"> <div ng-controller="createcompany"> <!-- section specific content here, directives etc --> </div> </div> </body> <body> <div ng-app="my-app"> <div ng-controller="dashboard"> <!-- section specific content here, directives etc --> </div> </div> </body>
Comments
Post a Comment