Questions tagged [angular-component-router]

84 questions
2
votes
1 answer

AngularJS: Browse page content not being displayed in Homepage

I'm a newbie to Angular and working on a project but I'm having an issue with displaying info in two different pages. I have a browse page that displays profiles I also have a homepage where I want to display the contents of the browse page plus…
2
votes
2 answers

Angular 1.5/2.0 Components, recommended to prefix?

When created the new Angular 1.5 or 2.0 components, should I still be prefixing the name of the component using 3 letters for example abc-my-component abc being a name to avoid duplication with other components? I was unsure if this is still…
2
votes
2 answers

Angular 1.5 Parent-Child Component Issue

I'm using Angular 1.5 Component router and having trouble getting a scope variable in the parent to be accessible in child components. I've created a plunker here that illustrates the problem. I've created a parent component with this view: …
Andy
  • 2,541
  • 4
  • 29
  • 60
2
votes
1 answer

Components navigate route

How to naviage to another component from current component? I have tried like this: account component: vm.$onInit = function () { var jwt = accountService.getJWT(); if (!jwt || jwtHelper.isTokenExpired(jwt)) { …
2
votes
1 answer

Angular 1 component router query params

I'm using angular 1 with new component router. I have $routeConfig like this: { path: '/list', name: 'ListCmp', component: 'listCmp', useAsDefault: true } I want to navigate to this component with custom query params. $router.navigate(['ListCmp',…
Andzej Maciusovic
  • 3,618
  • 1
  • 22
  • 36
2
votes
1 answer

Angular 1.5 component router sibling components

Is there a way with the new component router for Angular 1.5 to keep the sibling component rendered in the ng-outlet directive? I want to show the Detail View in parallel with the sibling List View. As far as I understand the official Docs…
paesku
  • 31
  • 7
2
votes
0 answers

Angular 2 rc 1 Component router not loading second component

I have setup my routing like that. When user browse to http://localhost:3000, if tries to load Home component. But if user hasn't logged, it redirect user to login component. @Component({ moduleId: module.id, selector: 'app', …
microchip78
  • 1,909
  • 1
  • 25
  • 36
2
votes
1 answer

Ng-outlet cannot access parent $scope

Using Angular's standard route I was able to have child controllers access the parent $scope:
Any Child controllers within ng-view would be able to access the ParentCtrl Data, but with…
HireLee
  • 489
  • 1
  • 9
  • 22
2
votes
1 answer

Cant get angular component router to work with lazyloading of components

Hello fellow stackoverflowers, I've been trying for some time now without success to implement lazy loading of angular components with the new component router (ngComponentRouter). This is the code I used for the configuration of the main…
2
votes
0 answers

AngularJS different child components vs child routes

Newbie using AngularJS 1.5 with ES6, a component-based design and the new Component Router. Let's consider a simple Survey application. Any given Survey has an instructions page and a list of Questions. When the end user accesses a given Survey, he…
Spiff
  • 2,148
  • 21
  • 30
2
votes
2 answers

New Angular 1 Component Router - Highlighting the link associated with the active route

I have a navbar with two links: I would like to highlight the link associated with the active route. Essentially, I would like to add a class called…
Naresh
  • 18,757
  • 25
  • 99
  • 162
2
votes
2 answers

Angular 1.5 $routerOnActivate on Root Router

I want to make sure that the user is logged in properly before proceeding to any of the components he/she's trying to reach, if they're not logged in. Send them to login. My idea is to do a check in the $routerOnActivate in the root router. Which…
1
vote
2 answers

How can I display a specific child component inside a parent component with its own routing in Angular?

I can easily display a child component inside a parent component, but how can I switch the displaying of a child based on a route? Is it possible to create a routing mechanism like this without using *ngIf's to hide and show the child components? I…
1
vote
1 answer

Load component after every button click on angular

I am experiencing some difficulties when I try to organize communication between two components in Angular. The parent's component is "animal" and the child component is "animalEspece". That's how my web page looks like now: When I click in a type…
1
vote
0 answers

Using router-outlet within a loop in angular

I am facing a very tricky situation. I have defined multiple routes that are mapped to different components in my application. I want to load the component corresponding to given route in which should not be a problem in usual…
Madhur Maurya
  • 806
  • 1
  • 13
  • 32