This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ng add @angular/material |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --save-dev @dfinity/agent @dfinity/candid @dfinity/principal process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ng g s ic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Angular imports | |
import { Injectable } from '@angular/core'; | |
import { environment } from './../environments/environment'; | |
// IC Imports | |
const Actor = require("@dfinity/agent").Actor; | |
const HttpAgent = require("@dfinity/agent").HttpAgent; | |
// candid declarations from the backend canister | |
const idlFactory = require('../../../backend/src/declarations/backend/backend.did.js').idlFactory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="margin:25px"> | |
<mat-tab-group animationDuration="0ms"> | |
<mat-tab label="First"> | |
<h1>{{ title }}</h1> | |
<p>{{ ic_response }}</p> | |
<input type="text" id="name" name="name" #name> | |
<button (click)="getGreet(name.value)">call greet</button> | |
</mat-tab> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {MatTabsModule} from '@angular/material/tabs'; | |
import {MatButtonModule} from '@angular/material/button'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MatTabsModule, | |
MatButtonModule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dfx canister id backend | |
> rrkah-fqaaa-aaaaa-aaaaq-cai | |
export const environment = { | |
production: false, | |
canisterId: 'rrkah-fqaaa-aaaaa-aaaaq-cai', | |
host: 'http://localhost:8000' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"types": ["node"] |