Skip to content

Instantly share code, notes, and snippets.

@wharley
Created February 11, 2017 21:09
Show Gist options
  • Save wharley/a5612fdd75988784ef87e8d1c4872324 to your computer and use it in GitHub Desktop.
Save wharley/a5612fdd75988784ef87e8d1c4872324 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { NavController, ViewController } from 'ionic-angular';
import { HomeService } from './home.service';
@Component({
selector: 'page-home',
templateUrl: 'home.html',
providers: [
HomeService
]
})
export class HomePage {
view: any;
data: any;
constructor(public navCtrl: NavController,public viewCtrl: ViewController, public service: HomeService) {
this.view = viewCtrl;
this.data = {
username: "",
password: ""
};
}
login() {
this.service.getFunctions()
.subscribe(
datas => {
if(datas)
console.log(datas)
//this.view.dismiss(this.data)
else alert("usuario ou senha inválido")
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment