Typescript error when running tsc

UI Components for Angular
Post Reply
mcwebdev
Posts: 68
Joined: 03 Mar 2016, 02:16

03 Mar 2016, 19:45

I am trying to create a home component. This is a simple div container to load PrimeNG components into.

Currently getting this error.
$ tsc
app/boot.ts(5,25): error TS2345: Argument of type 'typeof HomeComponent' is not assignable to parameter of type 'any[]'.
Property 'push' is missing in type 'typeof HomeComponent'.


boot.ts

Code: Select all

import {bootstrap}    from 'angular2/platform/browser';
import {AppComponent} from './app.component';
import {HomeComponent} from './components/home/home.component';

bootstrap(AppComponent, HomeComponent);
home.component.ts

Code: Select all

import {Component} from 'angular2/core';

@Component({
	selector: 'home',
	templateUrl: 'app/components/home/home.html'
})
export class HomeComponent {

}

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 Mar 2016, 20:13

The second parameter of bootstrap is providers array.

https://angular.io/docs/js/latest/api/p ... ction.html

I would suggest moving Home componet as a child of App component.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests