web

· Devlog/Web
Angular를 처음 접하시는 분들께서 양방향 바인딩 ( two-way binding ) 에 대해 배우실 때 쯤, ngModel 을 사용하다가 마주치게 될 확률 이 높은 에러 입니다. 문제점 // input-customer.component.ts import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-input-customer', templateUrl: './input-customer.component.html', styleUrls: ['./input-customer.component.css'] }) export class InputCustomerComponent implements OnInit { public inpu..
· Devlog/Web
문제점 사용자의 이름과 연락처가 적힌 데이터를 받아 온 후, 화면에 목록을 표시하는 작업을 하고자합니다. 사용자 목록을 표기하기 위해 ngFor를 사용하고, 사용자 정보가 하나도 없을경우엔 테이블이 완전 보이지 않도록 ngif로 처리하고자 다음과 같이 코드를 작성하였습니다. {{user.name}} / {{user.phone}} 그 뒤 컴파일을 진행하면, 아래와 같은 에러가 발생합니다. error NG5002: Can't have multiple template bindings on one element. Use only one attribute prefixed with * 구조적 지시문 ( structural directives ) 에 해당하는 ngIf , ngFor 와 같은 녀석들은 DOM을 직접 조..
· Devlog/Web
일반 전화번호부터 지역국번 및 전국대표번호까지 입력된 숫자에 맞춰 ' - ' 하이픈( hyphen )이 적용된 포멧으로 변환시켜줍니다. 사용방법 1. Module 초기화. // 필자가 전역으로 사용하는 모듈임. ***** 해당 모듈은 app.module.ts 에 import 됩니다. // app.module.ts 에 ContactPipe를 선언 (declarations) 하셔도 됩니다. // shared.module.ts import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; // ... import { ContactPipe } from 'src/sys/contact.pipe'; @NgModule({..
Damien.Lee
'web' 태그의 글 목록