I was wondering if anyone had a similar issue like what Im having now?
I was following the angular course on Scrimba, its lecture 7, angular component.
I created the angular app using cli command and tried to load and change the "loading..." section with "hello world" like the lecture, even copied the whole code and paste it in my local files and refresh the index.html but still didnt work!
I wonder if anyone knows or had a similar problem? Mucho thanks for any help!
this is what my app.component
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
template: `<h1>{{ title }}</h1>`,
templateUrl: './app.component.html',
styleUrls: ['./app.component.sass']
})
export class AppComponent implements OnInit {
title: string;
constructor(){ }
ngOnInit() {
this.title = 'hello';
}
}
and this is what my app.module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { CustomersComponent } from './customers/customers.component';
@NgModule({
declarations: [
AppComponent,
CustomersComponent
],
imports: [
BrowserModule,
AppRoutingModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
and this is my index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularProject</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>
Loading...
</app-root>
</body>
</html>
