TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Reena Lakra
NA
146
56k
Unable to get Id by routing in Angular 4
May 4 2018 5:05 AM
Hello,
I didn't get student id in my ts file by routing,
Student.html file contains :
<
table
>
<
tr
>
<
th
>
ID
</
th
>
<
th
>
Name
</
th
>
<
th
>
Age
</
th
>
</
tr
>
<
tr
*
ngFor
=
"let record of StudentList"
>
<
td
>
<
a
[routerLink]="['/students',record.ID]"
>
{{record.ID}}
</
a
>
</
td
>
<
td
>
{{record.Name}}
</
td
>
<
td
>
{{record.Age}}
</
td
>
</
tr
>
</
table
>
Student.component.ts file :
this
._activatedRoute.params.subscribe(params => {
this
.studentId = params[
'StudId'
];
});
Routing file contains
{path:
'students/:StudId'
,component:StudentComponent}
Reply
Answers (
4
)
Angular text box value
How to migrate AngularJS project in to Angular