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
Rahul Kumar
NA
43
9.3k
event.data.indexOf is not a function in angular 2
May 21 2018 2:56 AM
HTML Code:
<
select
class
=
"form-select style-1 selectbox"
sb
=
"48771331"
style
=
"display: none;"
formControlName
=
"AutoID"
>
<
option
selected
=
"0"
value
=
"0"
>
---Select Country---
</
option
>
<
option
*
ngFor
=
"let cd of countryData"
value
={{cd.AutoID}}
>
{{cd.Name}}
</
option
>
</
select
>
Component.ts:
ngOnInit() {
debugger;
this
.GetCountryList();
}
GetCountryList() {
this
.loading =
true
;
this
.schoolAddsService.GetCountryList()
.subscribe(data => {
this
.loading =
false
;
this
.countryData=data;
console.log(
this
.countryData);
},
error => {
console.log(
"Error :: "
+ error);
this
.loading =
false
;
}
)
}
Service.ts:
export
class
SchoolAddsService{
constructor(
private
http: Http) { }
GetCountryList() {
return
this
.http.
get
(environment.apiPath +
'Country/GetCountries'
)
.map((res: Response) => res.json())
.
catch
(
this
.handleError)
}
private
handleError(error: Response) {
return
Observable.
throw
(error.statusText);
}
}
Reply
Answers (
0
)
why we should use Angular ?
How to find reverse of a number using custom pipes?