With $stateProvider and abstract property in angular 1, I could create
different views with different template easily. For example in my
application I have Login and Register pages which are using *unauthTemplate*.
I have also Dashboard and Product pages that are using *commonTemplate*.
In Angular 1, here is my states
$stateProvider
.state('*unauthTemplate*', {
abstract: true,
url: '',
controller: 'unauthTemplateController',
templateUrl: '/app/common/unauthTemplate.html'
})
.state('*commonTemplate*', {
abstract: true,
url: '',
controller: 'commonTemplateController',
templateUrl: '/app/common/commonTemplate.html'
})
.state("*unauthTemplate*.login", {
url: "/Login",
controller: 'LoginController',
templateUrl: '/app/views/login.html'
})
.state("*unauthTemplate*.register", {
url: "/Register",
controller: 'RegisterController',
templateUrl: '/app/views/register.html'
})
.state("*commonTemplate*.dashboard", {
url: "/dashboard",
controller: 'DashboardController',
templateUrl: '/app/views/dashboard.html'
})
.state("*commonTemplate*.product", {
url: "/product",
controller: 'ProductController',
templateUrl: '/app/views/product.html'
})
Since there is not "Abstract property" in RouteConfig in Angular2, I could
not setup my app's route with the same approach in angular 1. Can someone
help me how can I have different view with different template.
Thanks
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.