角度7导航问题-routerLink无法重定向到另一页面

这是我的第一个组件从节点Web API列出数据的方式。当我单击主题时,它不会重定向到下一页。

//列出所有唯一的主题

@Component({
  selector: 'app-root',
  template: `<ul>
      <li *ngFor="let subject of subjects">
     <a [routerLink]="['/student/',subject.subjectId]" >{{subject.subject}}</a>
      </li>
  </ul>`,
  styleUrls: ['./app.component.css']
})
//fetch unique subjects using node api
export class AppComponent implements OnInit {
  title = 'List unique Subjects';
  subjects: any = [];

  constructor(private httpClient: HttpClient){}
  ngOnInit(){
    this.httpClient.get('http://localhost:5000/api/Subject').subscribe(data =>{


      console.log(data);
      this.subjects = data;
    })
  }
}

这是我的第二部分。它在控制台中显示错误Uncaught TypeError:无法读取未定义的属性“ innerHTML”

@Component({
  selector: 'app-student',
  templateUrl: './student.component.html',
  template: `<ul>
      <li *ngFor="let student of students">
      {{student.studentId}}
      </li>
  </ul>`,

  styleUrls: ['./student.component.css']
})

//fetch student details according to the passing subject id
export class StudentComponent implements OnInit {
    title = 'Student list';
    students: any = [];

 constructor(private httpClient: HttpClient){}
  ngOnInit(//alert(this.activeAouter.snapshot.params['id'])
  ){
    this.httpClient.get('http://localhost:5000/api/Student/ACC3TAX').subscribe(data =>{


      console.log(data);
      this.students = data;
    })
  }
}

和我的路由模块

const routes: Routes = [
{ path: 'home', component: StudentComponent },
{ path: 'api/Student/:id',redirectTo: 'home', pathMatch: 'full' }


];