angular2-routing

Create a detail view under a parent route

一世执手 提交于 2019-12-25 05:14:15
问题 You surely know the heroes sample from angular 2 tutorial: https://angular.io/resources/live-examples/toh-5/ts/plnkr.html When you click one of those 4 top heroes you get from the /dashboard url to the detail/id url. That the whole dashboard component is switched with the detail component is fine! What I would like to have changed is that the url changes from /dashboard to /dashboard/detail/id So in my route config I just change path: '/detail/:id', to path: '/dashboard/detail/:id', That

Create a detail view under a parent route

半城伤御伤魂 提交于 2019-12-25 05:14:05
问题 You surely know the heroes sample from angular 2 tutorial: https://angular.io/resources/live-examples/toh-5/ts/plnkr.html When you click one of those 4 top heroes you get from the /dashboard url to the detail/id url. That the whole dashboard component is switched with the detail component is fine! What I would like to have changed is that the url changes from /dashboard to /dashboard/detail/id So in my route config I just change path: '/detail/:id', to path: '/dashboard/detail/:id', That

Setting route params in child component reloads the page and resets

爱⌒轻易说出口 提交于 2019-12-25 04:34:10
问题 I'm trying to set 4 route params [area, branch, date, comments] in my child component StatusTable component, when I invoke the function goto() that navigates the url, the page reloads and resets to defaults. The issue will fix only if I pass ROUTE_PROVIDERS in StatusTable component instead of main.ts , but that will break other routes invoked with [routerLink] directive in templates. Not sure what's wrong, please help me fix the issue. status-table.component.ts (partial) @Component({ selector

How to show components in the content area of home component instead of separate page in Angular 5

人盡茶涼 提交于 2019-12-25 01:48:39
问题 I am new to Angular 5 ,Here I am facing a problem with component routing . What I want to do is ,When a user open the app first it should show a login screen (login screen with full height and width of browser window).Once the user is successfully validated then the user get into the Home Component . Here Home component has Toolbar and Side menu bar ,If user selected any any from side menu bar I want to show the relevant(component) data in the content area of the home component. As of now

Angular2 with routing when reloading the page gives Cannot GET?

左心房为你撑大大i 提交于 2019-12-25 01:09:19
问题 I am using Gulp Angular2 with route @RouteConfig([{path:'/contacts', name:'Contacts', component:ContactListComponent, useAsDefault: true }, {path:'/newcontact', name: 'NewContact', component:NewContactComponent}]) Included base <base href="/"> in HTML. Below is my gulpfile details gulp.task('serve', function(){ gulp.watch([config.allTs],['ts-lint','compile-ts']); browserSync({ port: 3000, files: ['index.html','**/*.js'], injectChanges: true, logFileChanges: false, logLevel: 'silent', notify:

display first tab as default when page loads

自古美人都是妖i 提交于 2019-12-24 20:35:01
问题 log.component.html: <clr-tabs> <clr-tab> <button style="margin-left: 3% !important;" clrTabLink [routerLink]="'log1'">Log1</button> <ng-template [(clrIfActive)]="log1"> <clr-tab-content> <div class="main-container"> <div class="content-container"> <div class="content-area"> <router-outlet></router-outlet> </div> </div> </div> </clr-tab-content> </ng-template> </clr-tab> <clr-tab> <button style="margin-left: 3% !important;" clrTabLink [routerLink]="'log2'">Log2</button> <ng-template [

Self referencing loop Detected for property in Asp.net MVC with Angular 2

℡╲_俬逩灬. 提交于 2019-12-24 19:44:19
问题 I Have Create a DB in that I am Having Multiple tables having Relationship between them. When a try to get data from my WEb app i get this error "'Self referencing loop detected with type 'System.Data.Entity.DynamicProxies.PrescriptionMaster_2C4C63F6E22DFF8E29DCAC8D06EBAE038831B58747056064834E80E41B5C4E4A'. Path '[0].Patient.PrescriptionMasters" I coudn't get why i am getting this error, and when i remove the relationships between tables i get proper data From it. I have Tried other solutions

Slider not working in home component in Angular4 Web-App

拜拜、爱过 提交于 2019-12-24 19:04:33
问题 I have created web app using angular4. All pages working properly with routing. The default page is a home page. Slider working perfect in home page When the app is loaded after that slider not working when I go to another page and then coming into a home page. I have loads all external css and js into index.html page. In home component, load just content with slider and some scripts for slider load into the one-night method. Home page works properly when page refresh or load First time

Is it possible to have multiple level Nested Route in Angular2

好久不见. 提交于 2019-12-24 16:40:34
问题 Is it possible to have multiple level nesting for angular routing. I am trying to achieve below but it says [Child routes are not allowed for "/cash/..". Use "..." on the parent's route path]. Intended route /storeselector /forms - shows all forms /forms/cash/ - user select cash form from list of forms and on load it will shows all orders /forms/cash/id:1/ shows order details /forms/cash/edit/1 edit order 1 below is my code. app component @Component({ selector : 'forms-app', templateUrl :

Subroutes in Angular2

断了今生、忘了曾经 提交于 2019-12-24 15:52:56
问题 I have a main component with routes: @Routes([ { path : "/auth/login", component: AuthComponent }, { path : "/", component: DefaultComponent } ]) DefaultComponent routes: @Routes([ { path : "/", component: LevelListComponent }, { path : "/levels/:id/add", component: LevelListComponent }, { path : "/levels/:id/edit", component: LevelListComponent }, { path : "/scripts", component: ScriptListComponent } ]) When I try to navigate to /scripts I see an error: app.js:44947 EXCEPTION: Error: