angular2 how do you route inside a route?

i am currently trying to create a news page that brings in new news stories which is placed in a side section of the page. on these stories i want to say read more and it take you to a new page. my problem is that this page is already within a route off of the main page .

my first page is this

import {Component} from 'angular2/core';
import {QuickQuestionComponent} from './quick-question.component';
import {NewsTickerComponent} from './news-ticker.component';
import {MoreNewsComponent} from './more-news.component';

import {RouteConfig,ROUTER_DIRECTIVES} from 'angular2/router';

    { path:"/question" , name: 'Question', component: QuickQuestionComponent },
    { path:"/news" , name: "News", component: NewsTickerComponent },
    { path:"/news/morenews" , name: "Morenews", component: MoreNewsComponent },
    { path:"/*other" , name: "other", redirectTo: ['Question'] }

    selector: 'my-app',
    template: `
        <nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            <a class="navbar-brand" href="#">Brand</a>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a [routerLink]="['Question']">Question</a></li>
                <li><a [routerLink]="['News']">News</a></li>
        <!-- /.navbar-collapse -->
    <!-- /.container-fluid -->

<div class="container">
<div> <!-- container -->
//               <quick-question></quick-question>
//               <news-ticker></news-ticker>
export class AppComponent { 

and and the link to news is clicked it comes up with the small news stories (i have signled them out) this page is this

import {Component} from 'angular2/core';
import {NewsTickerService} from './news-ticker.service';
import {SummaryPipe} from './summary.pipe';
import {MoreNewsComponent} from './more-news.component';

import {RouteConfig,ROUTER_DIRECTIVES} from 'angular2/router';

//    { path:"/morenews" , name: 'MoreNews', component: MoreNewsComponent }

    selector: 'news-ticker',
    template: `

    <h1> News Ticker </h1>n
    <div *ngFor="#new of news">
      <p>{{new.body | summary:60}}</p>n
      <p><strong><a> More Information </a></strong></p>
export class NewsTickerComponent { 

    constructor(newsTickerService: NewsTickerService) { = newsTickerService.getNews();

within this page i have had to comment out bits i have tried to make it display anything. so within the a I want to make it goto the more news component listed on the first page.

<p><strong><a [routerLink]="['morenews'] > More Information </a></strong></p>

sorry if this is a really long winded question but ultimately does anyone know how to link to another page in a angular 2 app which has its link in a component?

Leave a Reply

Notify of