
모듈이란? 프로그램은 단순하것에서 부터 복잡한것으로 진화를 한다. 그 과정에서 코드의 재활용성을 높이고, 유지보수를 쉽게 할 수 있는 다양한 기법들이 존재한다. (아주 좋으 부품을 만들어서 사용한다고 생각하면 된다.) 그 중 하나가 코드를 여러개의 파일로 분리하는 것. 분리시켜놓으니 => 원하는 코드 재활용이 가능하다. 필요한 로직을 빠르게 찾을 수 있다. 코드 개선시 이 코드를 사용한 모든 애플리케이션의 동작이 개선된다. 순수 자바스크립트에서 모듈이란 개념은 존재 하지 않는다고 한다. 개발하는 애플리케이션의 크기가 커지면 확장성과 유지보수 측면에서 파일을 여러 개로 분리하는 시점이온다. 이때 분리된 파일 각각을 '모듈'이라고 부른다. 내가 생각하는 모듈이란. 결국 코드의 묶음집 , 여러개의 파일로 분리..

시작 멈춤 리셋 import { Component, OnInit, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'app-buttons', templateUrl: './buttons.component.html', styleUrls: ['./buttons.component.css'], }) export class ButtonsComponent implements OnInit { @Output() clickEvent = new EventEmitter(); constructor() {} exectueButton(command: string) { this.clickEvent.emit(command); } ngOnInit(): void {..

리액트에서는 props라는 개념으로 데이터를 내려주고 올려주고가 가능했는데 앵귤러에서는 어떻게 시작을 해야할까. 버튼컴퍼넌트에서 import { Component, OnInit, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'app-buttons', templateUrl: './buttons.component.html', styleUrls: ['./buttons.component.css'], }) export class ButtonsComponent implements OnInit { @Output() clickEvent = new EventEmitter(); constructor() {} start() { this.clickE..

웹 스톱워치 만들어보기. 컴포넌트 구조를 위와 같이 짜게 될것이다. 컴포넌트 생성시 이전에는 직접 넣어줬지만. ng generator component 을 통하여 필요한 컴포넌트를 만들 수 있다. 좀 더 줄이면 ng g c 원하는이름 app.component.html에 아래와같이 만든 후 출력해보면 아래와 같이 나온다. 캡슐화가 된다. header component는 header component안에서. 모듈의 특징. 같은 컴포넌트를 꾸며주는데 헤더는 헤더, 섹션은 섹션 같은 class title을 사용하는데 캡슐화가 잘 되어 있다. 그런데. 이 섹션 컴퍼넌트에 styleUrls에 section 부분말고 footer.component.css를 넣어주면? 배열이기에 그 속성도 적용된다. section안에 ..
앵귤러에서 자주 쓰이는 타입스크립트 기법 1. 일반적 타입지정해주는 문법 let a : number = 10; 2. class문법 class App extends Parent { constructor(private http: httpClient) { //이런형태로 쓰인다 } } 3. 데코레이터 기법 function Component(constructorFn?: Function){ //클래스를 꾸며주는로직들 return constructorFn } @Component() class AppComponent{ @Input() height:number; constructor(){ } }

현대로와서는 정적인 웹 => 동적인 웹으로 고도화 됨에 따라, Single Page Application이 등장하고 이로인해 서버에 부담을 줄여주며 부드러운 화면구현이 가능한 CSR를 프론트엔드에서 많이 사용하고있다. SPA Single Page Application의 삼대장 vue, angular, react 앵귤러JS는 구글이 만든 단일 페이지 웹 애플리케이션 개발을 위한 자바스크립트 프레임워크 기초셋팅하기 1. CLI 설치 - npm install -g @angular/cli ※ 구버전 삭제방법 npm uninstall -g @angular/cli 2. 프로젝트 생성 - ng new 프로젝트명 - Would you like to add Angular routing? + yes - Which styl..