본문 바로가기

Web

(104)
function concept function = action 해야 할 일을 적어놓고 (definition) 그 일을 수행 (call) 함수 선언식 // The simplest function function sayHello() { alert('hello'); } sayHello(); 함수의 입력/출력 function sayMyName(name: string) { alert('name: ' + name); console.log('function sayMyName was called'); } sayMyName('a student studying typescript'); function addTwoNumber(a: number, b: number) { return a + b; } addTwoNumber(2, 3); // Nothing h..
형 변환 묵시적 형변환 // number to string var tmp = 100; tmp = tmp + ""; alert(typeof tmp);// string // string to number var tmp = "100"; tmp = tmp * 1; alert(typeof tmp);// number 명시적 형변환 Number(), String() // number to string var tmp = 100; alert(typeof tmp);// number tmp = String(tmp); alert(typeof tmp);// string // string to number var tmp = "100"; alert(typeof tmp);// string tmp = Number(tmp); alert(type..
Variables concept typescript variables// There are 3 basic types in Typescript var isDone: boolean = false; var age: number = 42; var myName: string = "Anders"; // Not sure which the type of the variable is var notSure: any = true; notSure = 23; notSure = "maybe a string"; null vs undefined // prints null var emptyVariable = null; console.log(emptyVariable); // prints undefined var newVariable; console.log(newVar..
Intro to Typescript Javascript that scales classesmodulesinterfacesgenericsstatic typing(optional) Setting npm install -g typescripttsc -vtsc main.tsmain.ts 파일을 main.js로 변환 typescript test? 필요한 파일들을 만들고, web browser에서 직접 확인terminal / cmd에서 console 확인typescript/javascript playground에서 직접 확인(http://www.typescriptlang.org/play)web browser에서 console 확인
ts vs js ts class Greeter { greeting: string; constructor (message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; } } js var Greeter = (function () { function Greeter(message) { this.greeting = message; } Greeter.prototype.greet = function () { return "Hello, " + this.greeting(); }; return Greeter; })();
[Ionic] 앱 개발을 위한 준비 1. NodeJS / NPM 설치 https://nodejs.org 2. Installing cordova / ionic - Install Ionic $ npm install -g cordova ionic 3. Done. Start! - Start an App $ ionic start --v2 myApp blank $ ionic start --v2 myApp tabs $ ionic start --v2 myApp sidemenu 4. Run! - Run your App $ cd myApp $ ionic serve -c -l 옵션 -c : 콘솔로그 확인 -l : 3가지 플랫폼을 동시에 웹브라우저에서 보여주며 앱크기에 맞게 보여줌
[Ionic] Ionic 2 framework란? Ionic 2 framework란?하이브리드 앱 개발 프레임워크 중 하나 장점- 웹기술(HTML, CSS, JAVASCRIPT 등)을 가지고 앱개발을 할 수 있다- 각 플랫폼(iOS, Android, Windows 등)에서의 개발을 동시에 한번에 진행할 수 있다- 개발 비용이 줄어들고 빠르게 개발 할 수 있다
Angular CLI에서 Bootstrap3 사용하기 http://codingthesmartway.com/using-bootstrap-with-angular/