gh0st gh0st - 1 year ago 97
Javascript Question

Implementing angular2 component into my project

I'm starting a new project with angular 2 using the angular-cli tool. I've run

ng install -g angular-cli
to install angular-cli. And then I've already run
ng new MyProject
to have angular-cli create the directory structure and files I need to get my new project up and running. Once angular-cli had that all built I changed directories into ~/MyProject and ran
npm install --save angular2-calendar

Now I want to use this component in MyProject. I had the impression this would be incredibly easy but either my google foo for finding instruction for angular2 is abysmal, or the documentation for angular2-calendar is.

This is what I've tried so far. After running the
npm install --save angular2-calendar
I went into my
file and added
import { CalendarModule } from 'angular2-calendar';
. I then went into my corresponding
to add the line

Basically all I want to do is write an angular2 app which uses the angular2-calendar to display data that my users enter into a form I will build.

Am I on the right track here? Am I missing a step I needed to take before running
ng new MyProject
? Is there a clean and clear tutorial on how to do this? Because isn't this a huge feature of angular? Being able to take someone else's module and use it in your project?

Answer Source

<CalendarModule></CalendarModule> will not work. I went to his demo site at:

and looked at the code for the demo. He shows you what to import and how to set it up. Hope this helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download