ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • AngularJS-기초_02
    카테고리 없음 2016. 2. 22. 23:52
    반응형
    1.  AngularJS 에서 Number,Strings,Object,Array 는 자바 스크립트에서와 거의 동일하다.

    2. ng-app
         Angularjs 어플리케이션을 초기화 한다.
    3. ng-app 과 ng-init 차이
         ng-app 은 어플리케이션을 초기화 하고, ng-init 은 데이터를 초기화 한다.
    4. ng-model
         html 에서 input,select,checkbox 의 값을 어플리케이션 데이터와 연결해준다.
         숫자,이메일,required 에 대한 타입(형) 검사를 할 수 있다.
         상태 검사를 제공한다.(invalid,dirty,touched,error..)
          html 요소를 위한 css 클래스를 제공.
         html 서식을 위한 html 요소를 연결.
    5. 데이터 바인딩이란?
         <div data-ng-app=“myApp” ng-init=“who=‘gavin’”>
         <p>Name: <input type=“text” ng-model=“who”></p>
         <p>I am : {{who}}</p>
         </div>
         {{who}} -> AngularJS 의 표현식이다.
         즉 AngularJS 데이터를 AngularJS 표현식과 동기화 한다.
         {{who}} 가 ng=model=“who” 와 동기화 된다.

    6.repeat:
         html 의 요소(element)를 반복한다.
         배열의 객체를 이용할 때 사용된다.
         <td ng-repeat=“x in numbers”>
              {{x}}
         설명: numbers 배열의 개수만큼 반복적으로 표시해준다.

    7. 


    반응형
Designed by Tistory.