본문 바로가기

Javascript/Angular

(22)
angular 5.2.4 + cordova 와 페이지 충돌 프로젝트에서 angular ^5.0.0 을 설정하고 개발한 적이 있다. 그때 당시는 아마도 버전이 5.2.3 정도 됐나보다 버전이 업데이트 되면서 5.2.4+ 에서는 cordova랑 routing에 충돌이 있는것같다. 다행이 구글내친구가 도와줘서 이문제를 해결할수가 있었다. 버전을 5.2.3으로 픽스 하고 angular 를 다시 설치하니 잘 되는것같다. 여러분 조심하세요. 오픈 소스가 다 좋은게 아니네요. 다른 분들은 이런 문제가 없길 바라며....
'Cannot find module '@angular-devkit/core' 아 무슨 에러인가 쩝 angualr 프로젝트를 오랜만에 열었다. 일이 있어서 빌드를 하려하는데 이게 웬일 빌드 자체가 안된다 angular/crl이 문제인가? 쩝 node_module삭제하고 다시 npm install 몇번을 했는지 모른다. 쩝 그러다가 웹서핑질을 하다가 아래와 같은 해법을 발견했다. 먼저 npm update -g @angular/cli (최신버전의 cli로 업데이트) "@angular/cli": "1.6.0" 을 꽁수?로 "@angular/cli": "^1.6.0" 이렇게 바꾼뒤 npm update 웬걸 이렇게 하니 된다. 아...힘들다. 버전관리 쩝. 남들은 제발고생하지 않길
Angular4 to Angular5 에러 발생 4=> 5로 업그레이드 하던 도중아래와 같은 오류가 발생하였다 검색해보니 typescript를 업데이트 해주면 된다고 한다"typescript": "~2.6.1", 위와같이 package.json을 수정하고 node_modules폴더를 지우고 다시 npm install 하니에러가 사려졌다 짜증나네 원인이 확실히 뭔지 몰라서 쩝 ERROR in ./node_modules/rxjs/_esm5/observable/BoundNodeCallbackObservable.js Module build failed: TypeError: Cannot read property 'type' of undefined at Object.getEffectiveTypeAnnotationNode (node_modules/typescrip..
Angular 5의 새로운 기능 :보다 쉬운 점진적인 웹 앱 https://www.infoworld.com/article/3213244/javascript/whats-new-in-angular-5-easier-progressive-web-apps.html 각도는 모바일 및 데스크톱 응용 프로그램을 구축하기위한 구글의 인기있는 자바 스크립트 프레임 워크는 , 지난 14 개월 동안 두 가지 주요 업그레이드와 함께, 험난한 한 해를 보냈습니다. 2017 년 11 월 1 일에 Angular 5.0.0이 도착하면서 다음 단계에 도달했습니다. 그러나 Google 기반의 프로그레시브 웹 앱 및 Material Design 기능에 대한 계획된 지원은 2017 년 11 월 말까지 출시 될 예정입니다. Angular 5.0.0 업그레이드 자체는 프레임 워크를 더 빠르고, 작고, 사..
Angular Polyfills error IE 또는 모바일 브라우저 Angular4로 프로젝트를 만들었는데 자꾸 에러가 나네요 IE에서는 iterator가 undefined로 나오고 허허 구글을 뒤져보니 간단하게 polyfills.ts파일에 주석처리한 부분을 없애라고 하네요 없애고 cordova로 씌어 해보니 잘 되네요 혹시 cordova와 angular를 같이 쓰시는 분은 아래의 파일을 참조하세요 /** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. * * This file is divided into 2 sections: * 1. Browser polyfills. These are..
component.css 에서 경로 못찾을때 오늘 컴파일 하는데 신기한 일이 일어났다 svg폴더를 /assets/images/a.svg 로 놓았는데 ng build --prod 하니 에러가 발생한 것이다. 음... 음... 생각하다가... assets/image/a.svg 경로를 절대경로로 /assets/image/a.svg 로 변경하니 빌드가 잘 된다 예상하건데 style optimizing 할때 떨어지는 파일 경로 때문인것같다.. 혹 안되시는분든 경로를 수정해 보면 좋을듯하다.
component에서 Pipe쓰기 음 view단에서 pipe를 쓰는게 아니라 component에서 써야할 경우가 있네요 일단 ngmoudle.ts provider에다가 사용할 pipe를 등록합니다. 전 providers: [DatePipe] 전 이렇게 등록했음 그리고 사용할 컴퍼넌트 생성자 함수에 주입주입시킵니다. constructor(private datePipe: DatePipe) { } 그다음 다음과 같이 쓰면 됩니다. this.date = this.datePipe.transform(new Date(), 'dd-MM-yy');
component 끼리 통신하기 상황 app.component.ts 에서 라우팅 되는 페이지들의 데이터를 받아서 처리해야할때 잘못 구현 된걸 수도 있는데 이런게 있다면 보심 될것같음 base.service.ts 서버스를 만들고 app.module에등록한다. import { Output, EventEmitter, Injectable } from '@angular/core';import { BehaviorSubject } from "rxjs/Rx"; @Injectable()export class BaseService { @Output() asideVisible = new BehaviorSubject(true); @Output() tabNumber = new BehaviorSubject(2); setAside(input: Boolean) {..