setting up ability to make ajax request

master
Matt Huntington 9 years ago
parent b93b740efc
commit 9a5d661410

@ -5,6 +5,7 @@ import { AppComponent } from './app.component';
import { SearchComponent } from './search/search.component';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
@NgModule({
declarations: [
@ -13,6 +14,7 @@ import { FormsModule } from '@angular/forms';
],
imports: [
BrowserModule,
HttpModule,
FormsModule
],
providers: [],

@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/toPromise';
@Component({
selector: 'app-search',
@ -7,7 +9,9 @@ import { Component, OnInit } from '@angular/core';
})
export class SearchComponent implements OnInit {
constructor() { }
constructor(
private http: Http
) { }
findCharacter(name){
console.log('finding ' + name);

Loading…
Cancel
Save