Skip to content

Instantly share code, notes, and snippets.

@samlinux
Created March 17, 2022 09:25
Show Gist options
  • Save samlinux/814efeccbda49e7968e325ff6f8b620b to your computer and use it in GitHub Desktop.
Save samlinux/814efeccbda49e7968e325ff6f8b620b to your computer and use it in GitHub Desktop.
Angular meets Internet Computer
import { Component } from '@angular/core';
import { IcService } from './ic.service' ;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
// my title
title:string = 'Angular meets IC';
// response to display into the template
ic_response:string = '';
// import the service to this component
constructor(private icService:IcService){}
// service call from the component
public async getGreet(name:string){
this.ic_response = await this.icService.greet(name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment