Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230916

Component not working

$
0
0

Yes I checked the selector a few times, tried changing to include a hyphen incase that was important too.
How is the module used for lazy loading then?
Here's my relavant code sections:-

"testcomp.ts"

import { Component } from '@angular/core';

@Component({
  selector: 'test-comp',
  templateUrl: 'testcomp.html'
})
export class Testcomp {
  text: string;
  constructor() {
    this.text = 'Hello World';
  }
}

"testcomp.html"
{{text}}

and in app.module.ts

...
import { Testcomp } from '../components/testcomp/testcomp';
...
@NgModule({
  declarations: [MyApp, Testcomp],
  imports: [
  .....

and referenced in my home page html here:

<test-comp></test-comp>


Viewing all articles
Browse latest Browse all 230916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>