I am using typescript version 1.8 and getting this error. I am new to typescript please help.
npm version: 3.9
File: ponymain-app.component.ts
import {Component} from '@angular/core';
@Component({
selector: 'ponyracer-app',
template: `<h1>Hye bud!</h1>`
})
File: Index.html
<body>
<ponyracer-app>
loading....
</ponyracer-app>
</body>
You need to attach the @Component decorator to a class directly and you will not get anything until you bootstrap your root component
I am assuming you main root component is PonyComponent
Here's a edited version of your code
import { bootstrap } from '@angular/platform-browser-dynamic';
import {Component} from '@angular/core';
@Component({
selector: 'ponyracer-app',
template: `<h1>Hye bud!</h1>`
})
class PonyComponent { }
bootstrap( PonyComponent );
Here's a good resource to start : https://angular.io/docs/js/latest/quickstart.html
Sometimes stopping and starting ng serve also helps. It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With