angularjs ng-controller

북마크 추가

 

아래와 같은 구조

ex)

<html ng-app="">

<div  ng-controller="controller">

<input type="text ng-model="ngModel">

</div>

</html>

<script>

function controller($scope,$http}{

 

$scope.ngModel =~~;

 

}

</script>

 

ng-controller로 선언한 태그 사이에 있는 ng-model 이나 기타 여러가지들을 컨트롤러 function안에 선언해 $scope 변수를 이용해 찾아 사용 할 수 있다.

 

AD
관리자
2014-07-19 20:41
SHARE