Tauri Init
This commit is contained in:
24
src/app/app.component.ts
Normal file
24
src/app/app.component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
standalone: true,
|
||||
imports: [CommonModule, RouterOutlet],
|
||||
templateUrl: './app.component.html',
|
||||
styleUrl: './app.component.css'
|
||||
})
|
||||
export class AppComponent {
|
||||
greetingMessage = "";
|
||||
|
||||
greet(event: SubmitEvent, name: string): void {
|
||||
event.preventDefault();
|
||||
|
||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||
invoke<string>("greet", { name }).then((text) => {
|
||||
this.greetingMessage = text;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user