Just starting out with TypeScript and attempting to set up a constants file in an Angular 6 Ionic/Cordova project. To create the service file, I used the Angular CLI command ng generate service appboot
When trying to implement a simple if-else statement, I encountered an issue where VSCode indicated that I was missing a comma. Additionally, when running 'ionic serve', an error occurred specifically when typing the 'else' keyword.
Here is a snippet from my appboot.service.ts file:
import { Injectable, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { environment } from '../environments/environment';
@Injectable({
providedIn: 'root'
})
export class AppbootService {
env: string;
constructor() {}
if (env == "dev"){
} else {}