본문 바로가기 메뉴 바로가기

시작이 반

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

시작이 반

검색하기 폼
  • 분류 전체보기 (51)
    • 여행 (14)
    • CSS (3)
    • Angular2 (4)
    • Ionic&cordova (13)
    • Objective C (13)
    • FrontEnd (2)
    • News (2)
  • 방명록

Angular2 (4)
Service 추가 및 사용

서비스 추가$ ng g service 서비스명 서비스는 Angular CLI 의 디렉토리 경로에 서비스명.service.ts 라는 이름으로 만들어진다. import { Injectable } from '@angular/core'; @Injectable()export class 서비스명Service { constructor() { } } @Injectable() 은 주입 가능한 클래스라는 뜻으로 사용한다. 소스 파악용으로 작성하므로 추가하도록 하자. 이렇게 만들어진 서비스는 컴퍼넌트에서 import 하고,@Component 내 providers의 배열로 추가한다. import { FirstService } from './서비스명.service'; @Component({ providers: [FirstSer..

Angular2 2016. 12. 28. 16:17
Shadow DOM 스타일

:host {...}쉐도우 돔 전체를 감싼다. template: `엄마 딸`,styles: [`:host {display: block;border: 2px solid #000;width: 300px;}`] 결과로 border 2픽셀 짜리 검정 실선이 엄마부터 딸까지 전부를 감싼다. :host(.className) { ... }부모컴퍼넌트에 쓰인 자신의 컴퍼넌트 클래스명에 의해 스타일이 변경 부모selector: 'parent',template: `엄마 `,styles: [`:host {display: block;border: 2px solid #000;width: 300px;}`] 자식selector: 'child',template: `딸`,styles: [`:host(.smile) {display: b..

Angular2 2016. 12. 22. 10:32
What's the difference between @ViewChild and @ContentChild?

출처 : http://stackoverflow.com/questions/34326745/whats-the-difference-between-viewchild-and-contentchild Q : Angular 2 provides @ViewChild, @ViewChildren, @ContentChild and @ContentChildren decorators for querying a component's descendant elements. What's the difference between the first two and the latter two?A : I'll answer your question using Shadow DOM and Light DOM terminology (it have come..

Angular2 2016. 12. 21. 17:21
Angular2 CLI로 프로젝트 관리하기

1. Angular CLI# Angular CLI 설치$ npm install -g angular-cli # Angular CLI 프로젝트 생성 (먼저, 프로젝트를 만들 디렉토리로 이동후에 해야 함.)$ ng new 프로젝트명 # Angular CLI 프로젝트로 이동$ cd 프로젝트명 # Angular CLI 프로젝트 개발 서버 실행$ ng serve기본 로컬호스트:기본포트 http://localhost:4200/ 포트변경 HTTP 서버 포트, 라이브리로드 서버 포트 $ ng serve --port 4201 --live-reload-port 49000 2. Angular CLI를 이용한 Angular 구성요소 추가# 컴포넌트 추가$ ng g component 컴포넌트명컴퍼넌트의 경우 /app/컴퍼넌트명/..

Angular2 2016. 12. 19. 13:50
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • FCMPlugin.gradle
  • 뉴욕한인민박
  • Cordova
  • 환승후기
  • 에어캐나다후기
  • Gradle3.3
  • ionic
  • 한인민박
  • 한인민박후기
  • 미국전화후기
  • splashscreen
  • google-services
  • ionic3
  • avds
  • 종로일리아스
  • H2O유심후기
  • 결혼준비그램
  • Android
  • 뉴욕호텔민박
  • 간편로그인
  • google-analytics
  • 에어캐나다환승후기
  • 내돈내산
  • 미국유심후기
  • 카톡로그인
  • 일리아스주얼리
  • 에어캐나다 기내식
  • 에어캐나다
  • android_home
  • ionic2
more
«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory / Customized by 달고나™

티스토리툴바