2017-10-31 3 views
0

각도로 새롭게 -이 각도 달력 구성 요소를 여기에있는 https://github.com/mattlewis92/angular-calendar에서 찾으면 문제가 발생합니다.Angular 4 CLI 프로젝트에서 각도 달력 구현

각도 형 CLI를 사용하여 기본 프로젝트를 설정하고 있습니다. Getting Started 가이드에 따라 .css 파일을 어떻게 또는 어디에 포함할지 모르겠습니다. 나는 몇 가지 반점을 시도했다.

그걸 알아낼 수 없으면, 나는 repo의 build-tools/angular-CLI 페이지로 가서 그것을 복제했다. 이것은 Angular CLI를 사용하여 만들어진 기본 프로젝트라고 가정합니다.

나는이 프로젝트에 봉사 할 때 달력 일뿐입니다. 여기, 내가 원하는 기능을 많이 발견 누락 -

https://mattlewis92.github.io/angular-calendar/#/kitchen-sink

이의 모습이 enter image description here

누군가가 나 그냥 각도 CLI를 사용하여 만든 프로젝트로 달력을 구현하는 데 도움이 수 있습니까? 그것은 여기에 어떻게 보이는지 매우 유사 -

https://mattlewis92.github.io/angular-calendar/#/kitchen-sink

감사

+0

'그냥 달력'이란 무엇입니까? – komron

+0

스크린 샷을 추가했습니다. 예를 들어 월이 표시되지 않고 월 등을 변경할 수 없습니다.보기가 어렵습니다. – fpolig01

+0

나는 당신이이 프로젝트를 복제했다는 것을 정확히 이해하고 있는가 : https://mattlewis92.github.io/angular-calendar/#/kitchen-sink 그리고'ng serve'를 실행하지만 캘린더는 그 방법이 아니다. 대지? – komron

답변

2

이는 NPM 패키지, 그래서 먼저 각 프로젝트를 작성해야합니다, 당신은 각도 CLI ng new를 통해 쉽게 할 수 있습니다. 그런 다음 프로젝트 디렉토리에서 terminal/bash를 열고 npm i을 실행 한 다음 npm i --save angular-calendar을 수행해야합니다.

AppModule.ts에

이동 및 달력 모듈을 추가, appModule의 코드는 다음과 같이 STH해야한다 :

import { NgModule } from '@angular/core'; 
import { BrowserAnimationsModule } from '@angular/platform- 
browser/animations'; 
import { CalendarModule } from 'angular-calendar'; 

@NgModule({ 
    imports: [ 
    BrowserAnimationsModule, 
    CalendarModule.forRoot() 
    ] 
}) 
export class MyModule {} 

그런 다음 그것은 당신의 프로젝트 루트에 .angular-cli.json 파일로 이동합니다. 섹션 styles을 찾아 거기에 node_modules/angular-calendar/dist/css/angular-calendar.css을 추가하십시오.

는이 같은 STH해야한다 :

"styles": [ 
     "../node_modules/font-awesome/css/font-awesome.css", 
     "../node_modules/simple-line-icons/css/simple-line-icons.css", 
     "../node_modules/angular-calendar/dist/css/angular-calendar.css", 
     "scss/style.scss" 
     ], 

그런 다음 프로젝트 루트로 돌아가서 예를 들어 구성 요소 ng g component calendComp를 생성하고이 문서의에 설명 것 같이 거기에 달력을 사용합니다.

+0

고맙습니다. 구성 요소를 생성했지만 캘린더 사용법을 모릅니다. 필자는 주 앱 구성 요소에 태그를 포함 시키려고했지만 calend-comp.component.html은 calend-comp가 작동하는 것을 보여줍니다. – fpolig01

+0

이제 캘린더를 https://mattlewis92.github.io/angular-calendar/#/kitchen-sink에서 볼 수 있습니다. component.ts 및 template.html을 참조하십시오. – komron

+0

어떻게 '를 주 앱 구성 요소에 포함 시키시겠습니까? – komron

관련 문제