1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to create a standalone project

Discussão em 'Angular' iniciado por user, Setembro 24, 2024.

  1. user

    user Guest

    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)]
    };

    Continue reading...

Compartilhe esta Página