I had never used standalone before. And now I wanted to try.
I created a new project using the command:
lang-bash ng new client --style=scss --standalone
And when I tried to run the project, I get a blank page with an error
Uncaught SyntaxError: Unexpected token '{'
I didn’t make any changes to the project.
I’m using:
"@angular/cli": "^16.2.15",
"typescript": "^5.1.3"
Why does it give an error right when the “hello world” page starts?
main.ts
:
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));
app.config.ts
:
import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes)]
};
3