angular2의 튜토리얼을 따라가며 기억해야 할 점들을 기록한 gist.
Tutorial-3 - Master/Detail
- input의 ngModel directive는 input value와 변수를 묶어준다.
# -*- coding: utf-8 -*- | |
# coded by eunjoo sohn. hanyang university | |
import re, sys, os, random, datetime | |
import mechanize | |
from bs4 import BeautifulSoup | |
from sqlalchemy import create_engine, MetaData, Table | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base |
angular2의 튜토리얼을 따라가며 기억해야 할 점들을 기록한 gist.
Tutorial-3 - Master/Detail
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
enum CompassPoint { | |
case east | |
case west | |
case south | |
case north | |
} |
var directionToHead = CompassPoint.west | |
// or | |
var directionToHead: CompassPoint = .west |
var directionToHead = CompassPoint.west | |
// or | |
var directionToHead: CompassPoint = .west |
switch directionToHead { | |
case .west: | |
print("do something") | |
case .north: | |
print("do another thing") | |
default: | |
break | |
} |
// Enumeration of type Fruit. | |
enum Fruit: Int { | |
case apple = 1000 | |
case banana = 500 | |
case grape = 2500 | |
} | |
// declare variable. | |
let orderedFruit: Fruit = .apple |
enum Cloud { | |
case cirrus | |
case cumulus | |
case altocumulus | |
case cumulonimbus | |
} | |
enum WeatherCondition { | |
case sunny(temperature: Float) | |
case rainy(inchesPerHour: Float) |
// declare variables. | |
var today = WeatherCondition.sunny(24) | |
var yesterday = WeatherCondition.cloudy(Cloud.cirrus, 10) | |
switch today { | |
case .sunny(let temperature): | |
print("today's temperature is \(temperature).") | |
case .rainy(let inchesPerHour): | |
print("\(inchesPerHour) inches of rainwater.") |