I am new to Cobalt so I built for Windows and created a very simple Angular 16 application with two components so I could test the routing. Each component has a button to route back to the other. The project was created with:
- ng create basic-angular
- ng generate component screen1
- ng generate component screen2
- Changed the body background to #dedede
- Added the routing by adding to app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
...
RouterModule.forRoot([
{path: 'screen1', component: Screen1Component},
{path: 'screen2', component: Screen2Component},
{path: '', redirectTo: '/screen1', pathMatch: 'full'},
]),
- Added the screen1 html
<div>screen1 works!</div>
<button routerLink="/screen2">To Screen2</button>
- Added the screen2 html
<div>screen2 works!</div>
<button routerLink="/screen1">To Screen1</button>
I start the application using: npm start or ng serve
When I run the application within Cobalt I get the correct body background color and nothing else is displayed. I opened the remote web debugger and I don't see anything useful. The app renders fine through Chrome.
These are the screens within Chrome.
I then realized button elements were not supported so I create a new app using ng new simple and removed all the HTML in the app.component and added a simple div with a non-black color and background and some text to display. I run the app and it too does not work--works in Chrome.
I played some more and learned the script element of type "module" is not supported. Assuming this is correct, how can angular work at all?
Does Cobalt support Angular 16? I have seen previous posts suggesting older version of Angular were supported but no real details. Is there anything I can do to fix the problem?
