Questions tagged [angular-component-router]
85 questions
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…

chuckd
- 13,460
- 29
- 152
- 331
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…

Alain Al-Shikhley
- 43
- 6
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
- 1,016
- 4
- 19
- 42
1
vote
1 answer
Angular 7 url routing configuration
I'm working on an angular 7 application, where I have been facing an interesting issue right now.
My aim is to not using the "hardcoded URLs" throughout in the application.
So, I have an approach like maintaining a single config file where I can…

siva nanda perumal
- 153
- 10
1
vote
0 answers
$routerOnActivate called twice in AngularJS
In one page, we have a link on click of which we make a route change.
See Tasks
And the route is defined as in our app.js:
$routeConfig:…

StrugglingCoder
- 4,781
- 16
- 69
- 103
1
vote
1 answer
Angular 4: How to use same component as both parent and child?
My requirement is to have tree of forms.In the parent form on click of button only child form will be created. It can go on like this upto n-levels.
My approach:
I have created one component. This is used as both parent and child. on click of…

rajesh
- 2,354
- 1
- 12
- 15
1
vote
0 answers
Angular 1.5, component router detect unsaved changes and alert
When I use angular 1.3, I am used this (Detect Unsaved changes and alert user using angularjs) to detect unsaved change and alert to user, everything work fine. But when use angular 1.5 (component router) the value of $ctrl.form.$dirty was destroyed…

Phan Hoàng Nhân
- 990
- 1
- 8
- 21
1
vote
1 answer
How to retain same page when browser is refreshed in Angular 1.5?
In my project the router is set up like this :
myApp.component("rsapproot", {
transclude: true,
template: " ",
$routeConfig: [
{ path: "/login", component: "rsapplogin", name:…

StrugglingCoder
- 4,781
- 16
- 69
- 103
1
vote
0 answers
Angular 2 Components Interaction
I have a custom datagrid which i am trying to interact in my main component.
My Custom datagrid.component.ts
import { Component, EventEmitter, Injectable, Output, Input, OnChanges, OnInit, Host} from '@angular/core';
import { DataGridColumn,…

Venk
- 11
- 6
1
vote
1 answer
Angular2: Not able to navigate to child routes directly
I have created routes like this
{path: 'trainings', component: TrainingWrapperComponent,
children:[
{path: '', component: TrainingsListComponent},
{path: 'createTraining', component: ManageTrainingComponent},
{path: 'trainingLanguage',…

Pratik Barasia
- 561
- 1
- 3
- 14
1
vote
1 answer
Running a code when ever a component is loaded in angular 2 similar to angular 1 app.run
Am starting with angular 2
I have few question like
In angular one i used to define a variable in routing config and based on that variable i wrote a code inside app.run() which will check if that variable is true something should happen.
SO what it…

RKD
- 405
- 1
- 5
- 16
1
vote
3 answers
Which router for Angular1.5?
This question seems a bit "IdidntwanttosearchonGoogle" but I did. A lot, and anything worked.
I'm trying to build a little web app with angular 1.5. The problem is that I never used route (NEVER !), and Angular 1.5 seems ambiguous about it. I've…

Kalas Yagami
- 183
- 1
- 20
1
vote
1 answer
event.preventDefault() on $locationChangeStart doesn't work as expected
I have a strange problem with calling the e.preventDefault inside handler for a $locationChangeStart event. I have something like this:
var unregisterCallback = _this.$rootScope.$on('$locationChangeStart', function (e) {
…

macwier
- 1,063
- 1
- 6
- 19
1
vote
1 answer
How to maintain states across router outlets using the url in Angular2 Component router?
The requirement I am trying to implement using Angular2 and the new component router is as follows:
A page is divided into 2 sections. eg: (left,right) Each section will contain a component. Each component has its own routing and states. Is there…

rmchndrng
- 782
- 1
- 8
- 18
1
vote
0 answers
angular 1.5 component router pass values or callbacks between components
I created app with angularjs 1.5 component router, how could I let parent component pass values to child component inside and child component binds callbacks to the parent component like:
app.js
angular.module('newsApp',['ngComponentRouter'])
…

Slaiman Aris
- 111
- 3
- 8