I am writing a boilerplate Angular app on StackBlitz and I am getting an error on initial load, but the app loads fine when I make any change in the editor.
Error in /turbo_modules/@angular/compiler@6.0.7/bundles/compiler.umd.js (301:17) Can't resolve all parameters for MainComponent: (?). Evaluating main.ts Booting application
The app is HERE. Main component, which seems to be throwing looks like this, I don't see any missing parameters (I don't think this is worth more than skimming, just pasted for reference):
import { Component } from '@angular/core'
import { Router } from '@angular/router';
@Component({
selector: 'main-component',
template: `
<ul>
<li>
<a [ngClass] = "{ active: (activeLink === 'Home') }"
(click) = "goHome()">
HOME
</a>
</li>
<li>
<a [ngClass] = "{ active: (activeLink === 'News') }"
(click) = "goToNews()">
NEWS
</a>
</li>
</ul>
<br>
<router-outlet></router-outlet>
`,
styleUrls: ['main.component.css']
})
export class MainComponent{
constructor(private router: Router) {}
public activeLink = 'Home'; //default
public goToNews() {
this.activeLink = 'News';
this.router.navigate(['/news']);
}
public goHome() {
this.activeLink = 'Home';
this.router.navigate(['/home']);
}
}
What's causing the error, how do I fix it?
Edit: Looks like changing the main component code (like adding a space, anything) causes the app to temporarily "fix itself" - might be a StackBlitz issue.