0

Hi I am working on Angular 4. I have some functionalities (say functionality1, functionality2, ..., functionalityN) which is implemented in corresponding components(say component1, component2, ..., componentN). In my app I implemented notifications on the header. If some updations are occured, those are updated on notification, as usual. I provide routing to corresponding component as well.

Some of my components have individual view (i.e.,say component2 is not there, but component2/user1 , component2/user2, ..., component2/userN). I can access components from the notification list, but the issue I am facing is that, once I reach component2/user1 then nothing happens when try to access component2/user2, component2/user3, ... component2/userN. But I can access component2, component3, ..., componentN from component2/user1, component2/user2, ..., component2/userN.

What I understood is that issue is because component2/user1 , component2/user2, ..., component2/userN are just the views of single component component2. But there exists component2/user1 , component2/user2, ..., component2/userN and they are accessible from component1, component3, component4, ... componentN.

To access id based view of same component, from that component itself what should I do?

Hope some one can help

2
  • 1
    Need to see code Commented Nov 2, 2017 at 4:56
  • ngOnInit() { this.activatedRoute.params.subscribe(params => { this.id = +params['id']; this.initialize(this.id); }); } Commented Nov 2, 2017 at 7:05

1 Answer 1

1

You can solve it by placing this.initialize(this.id); inside the subscibe method. The change is only visible there

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.