I made an enum with Typescript to use in MyService.service.ts MyComponent.component.ts and MyComponent.component.html.
export enum ConnectionResult {
Succes
The scope of the template is limited to the component instance members. If you want to refer to something it needs to be available there
class MyComponent {
public get connectionResult(): typeof ConnectionResult {
return ConnectionResult;
}
}
In the HTML you can now use
*ngIf="connectionResult.Success"
See also Angular2 access global variables from HTML template