How to launch windows app (EXE) in Angular
How to launch an exe file such as notepad.exe from a component. (Confirmed only in IE11)
To run Angular in IE, you need to edit polyfills.ts under src.
All of the above comments must be removed.
Otherwise, if you want to use web-animations-js in IE, you need to enable the import statement for that location.
Launch notepad.exe in Angular 6
Now let’s start notepad.exe.
app.component.ts
import { Component } from '@angular/core'; interface ActiveXObject { new(s: string): any; } declare const ActiveXObject: ActiveXObject; @Component({ selector: 'app-root', template: ` <button (click)='onClick()'<ボタン>/button> `, styleUrls: ['./app.component.styl'] }) export class AppComponent { public onClick(){ const app = new ActiveXObject('WScript.Shell'); app.Run('notepad.exe'); } }
Change the local intranet settings in IE11 as follows
Now run ng serve –open and start IE11.
button to start notepad.
コメント