Skip to content

Instantly share code, notes, and snippets.

@krejko
Created January 13, 2018 21:27
Show Gist options
  • Save krejko/3130398c8a6be1e332fbc6fe57e54f41 to your computer and use it in GitHub Desktop.
Save krejko/3130398c8a6be1e332fbc6fe57e54f41 to your computer and use it in GitHub Desktop.
View Component
import { LoginService } from './login.service';
export class ViewComponent implements OnInit {
constructor(private loginService: LoginService) {}
ngOnInit() {
if (this.loginService.login('tester', 'password')) {
console.log('Logged In');
} else {
console.log('Invalid auth');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment