반응형

[마소] 2013.05 Angular.JS 의 구조와 특징

 

예제를 로컬에 구현해 보았다.

여러번 해본 것이지만 예제 나온김에 한번 더.

angular.js 파일은 받아두어야 한다.

 

기본적으로 일단 <html> 태그에 ng-app 를 입력해주어야 한다.

<body>에는 ng-controller 를 입력해주어야 한다.

 반복문은 반복하려는 구문에  ng-repeat 를 입력해주면 해당 데이터 배열 갯수만큼 반복된다.

 

 $scope로 데이터를 전달한다.

 데이터 출력은 "{{데이터}}"의 형식으로 된다.

 

모델은 $scope의 속성값이다. (todoList)

뷰는 DOM, 보이는 템플릿 자체가 뷰인 셈이다.

컨트롤러는 자바스크립트 함수로, $scope를 argument로 가지고 있다.  

 

※ Angular.JS 에서 사용하는 지시문

 

 ng-app

 Declares an element as a root element of the application allowing behavior to be modified through custom HTML tags.

 ng-bind

 Automatically changes the text of a HTML element to the value of a given expression.

 ng-model

 Similar to ng-bind, but allows two-way data binding between the view and the scope.

 ng-class

 Allows class attributes to be dynamically loaded.

 ng-controller

 Specifies a JavaScript controller class that evaluates HTML expressions.

 ng-repeat

 Instantiate an element once per item from a collection.

 ng-show

& ng-hide

 Instantiate an element once per item from a collection.

 ng-switch

 Conditionally instantiate one template from a set of choices, depending on the value of a selection expression.

 ng-view

 The base directive responsible for handling routes that resolve JSON before rendering templates driven by specified controllers.

 

 

Model–view–controller (MVC)

 

 

 

 Model          >     JS Objects

 View            >     DOM

 Controller     >     JS Function

 

 

Template, Model, View 방식으로 구현된다.  
   
(참고 : http://docs.angularjs.org/#!/tutorial/step_04)

 

 

예제 구현 화면 

 

소스 화면 (Sublime Text 2) 

 

.

반응형
반응형

Text editor -텍스트에디터 : Brackets

 

http://brackets.io/

 

Download : http://download.brackets.io/

 

Brackets is an open-source editor for web design and development built on top of web technologies such as HTML, CSS and JavaScript. The project was created and is maintained by Adobe, and is released under an MIT License.

 

 

 

 

 

 

반응형

'프로그래밍 > Web' 카테고리의 다른 글

PreloadJS  (0) 2013.06.20
Angular.JS 의 구조와 특징  (0) 2013.06.13
Text editor - 텍스트 에디터 : Sublime with TrailingSpaces  (0) 2013.06.13
ICEcoder — In-browser code editor  (0) 2013.06.04
APTANA - SVN 설치 (subclipse)  (0) 2013.05.28
반응형

Text editor - 텍스트 에디터 : Sublime with TrailingSpaces

 

Sublime : http://www.sublimetext.com/

 └ (plugin) TrailingSpaces : https://github.com/SublimeText/TrailingSpaces

 

 Download :

                   http://www.sublimetext.com/2

                   http://www.sublimetext.com/3

Sublime Text 2.0.1 x64 Setup.exe

 

TrailingSpaces-master.zip

 

Sublime Text

Sublime Text is a sophisticated text editor for code, markup and prose.
You'll love the slick user interface, extraordinary features and amazing performance.

 

Trailing Spaces

A Sublime Text 2 and3 plugin that allows you to…

highlight trailing spaces and delete them in a flash!


 

 

Sublime의 awesome한 기능들.

 

Use Multiple Selections to rename variables quickly.
Here Ctrl+D is used to select the next occurrence of the current word. 

 

단어를 선택한 다음 "Ctrl + D" 를 처음 누르면 선택된 동일 단어 전체 검색.

"Ctrl + D" 를 계속 누르면 동일 단어가 순차적으로 선택되고, 순차적으로 선택된 단어는 동시 수정이 가능하다.

 

 Make batch edits with Multiple Selections.
Here Ctrl+Shift+L is used to split a selection into lines, and each line is then edited simultaneously.

 

영역 선택 후 "Ctrl + Shift + L" 를 선택하면 세로영역 선택이 된다. 세로줄에 커서가 생성됨.

 

 The Command Palette gives fast access to functionality.
Here Ctrl+Shift+P is used to show the Command Palette, "sspy" (short for Set Syntax: Python) is used set the syntax of the current file to Python.

 

"Ctrl + Shift + P"를 누르고 해당 파레트를 선택하면 명령어 파레트를 선택할 수 있다.  

예를 들어 Python의 Syntax를 사용하려면, "Ctrl + Shift + P"를 누르고, "sspy"라고 입력하면 "Set Suntax : Python" 이 선택된다. 선택하고 나면  해당 파일의 구문들이 Python에 맞는 구문색상으로 변경된다.

 

 Use Goto Anything to quickly navigate between files, even in the largest projects.
Ctrl+P shows Goto Anything, and typing then filters on file and directory names.

 

"File" - "Open Folder" 를 해서 폴더를 열었을 경우, 또는 여러 개의 파일이 열려있을 경우 "Ctrl + P"를 누르고 열려 있는 파일 또는 폴더에 존재하는 파일을 검색해서 바로 open 할 수  있다.

 

 Goto Anything can also be used to show a function, line or word within a file.
Type @ after a file name to filter on symbols. More...

 

"Ctrl + P"를 누르고 파일을 검색하는데, 해당 파일이 선택되었을때, 검색어 바로 뒤에 "@"를 입력하면 해당 파일에 존재하는 함수들을 검색 할 수 있다.

 

 

 

 Find and Replace with regular expressions.
Here unwanted whitespace is removed by using the regex " +" to find groups of spaces, which are then selected simultaneously with the Find All button.

 

"Ctrl + F"를 눌러서 "Find and Replace"를 할 경우 "공백(space)"을 입력하고 "+"를 넣으면 해당 공백 사이즈와 동일한 공백을 찾을 수 있고, 삭제 또는 교체 가능하다.

 

 

 

Trailing spaces 를 윈도우에서 설치할 때.

압축 풀고, "C:\Users\사용자폴더\AppData\Roaming\Sublime Text 2\Packages"에 폴더채로 옮겨두고 Sublime 재 실행 하면 확인 가능하다.

 

 

 

 

 

반응형
반응형
"우리 안의 강한 충동,
우리 안에 있는 폭군에게는
우리의 이성뿐만 아니라 양심도 굴복하게 된다."
자기 자신을 부정하고 원한과 미움을 가진 사람은
스스로에게 불만스러울 뿐 아니라 주변 사람에게도
부정적인 생각과 마음을 그대로 표현하게 된다.
즉 그는 스스로 폭군이 되어 자신을 부정하며
타인에게도 폭력적이 된다.


- 김정현의《철학과 마음의 치유》중에서 -


* 평소 그렇게 보이지 않았던 사람도
어느 한순간에 폭군으로 변하기도 합니다.
내 안의 '폭군'이 별것도 아닌 일에 욱하고 튀어나와
자기 자신은 물론 다른 사람에게도 상처를 냅니다.
그래서, 내 안의 폭군을 얼른 몰아내야 합니다.
그 빈자리에 천사를 모시면 미소가 번지고
내 안의 꽃을 피우면 향기가 번집니다.

 

반응형
반응형
'나중에' 보다 더 고약한 말이 있을까?
나중에는 우리가 스스로 꿈을 깨려고 휘두르는 망치,
스스로 성공 기회를 가로막으려고 세우는
수많은 장벽중 하나다.
내일 시작하는 다이어트,
다음에 하게 될 구직활동,
언젠가 좇을 인생의 꿈은 우리 손으로 만든
다른 걸림돌과 결합해 그냥 되는대로 살아가게 만든다.
-제니퍼 리드

 

중요한 일을 미루는 것은 불행한 사람들,
실패한 사람들의 공통점입니다.
이민규 교수는 ‘내일과 나중은 패자들의 단어이고,
오늘과 지금은 승자들의 단어다.’고 했습니다.
지금 못하는 사람들은 나중에 조건이 갖춰져도 못하게 됩니다.

 

반응형

'생활의 발견 > 아침편지' 카테고리의 다른 글

잘 자는 아기 만드는 '잠깐 멈추기'  (0) 2013.06.15
저 꽃들처럼  (0) 2013.06.14
뿌리와 날개  (0) 2013.06.12
청춘의 특권  (0) 2013.06.11
사치  (0) 2013.06.10
반응형

호갱(님)은 어수룩하여 이용하기 좋은 손님을 지칭하는 단어이다.


국어사전에서 호구4의 2번 뜻과 비슷한 의미이다.

2. 어수룩하여 이용하기 좋은 사람을 비유적으로 이르는 말.


활용된 예문
어떤 사람이 오프라인 매장에서 산 물건을 인터넷에 "정가가 얼마인가요?"라고 질문을 올린다. 그러면 이런 리플이 달릴수도 있다. 호갱님~ 낚이셨네요.
 
반응형
반응형
"천재란 영원한 인내심이다" - 미켈란젤로 -

 

반응형
반응형

도심 멧돼지 출몰, 진돗개와 혈투

역시 진돗개인가?

 

반응형

'여행_사진_영상 > MV_VOD' 카테고리의 다른 글

[UCC] 원조탑기어의 위엄  (0) 2013.07.09
황해 2013.06.22  (0) 2013.06.24
Asphalt 8: Airborne - Teaser trailer  (0) 2013.06.12
프로그래머가 수학을 못하면  (0) 2013.06.12
[UCC] WorldWar Z  (0) 2013.06.11

+ Recent posts