jquery를 사용한다면 간단하게 $("#id").focus() 하면 될 일이지만서도....... angularjs를 이용한다면, 디렉티브를 만들어서 element 조작을 통해서 포커스를 지정한다. -_-뭔가, 복잡스럽다. 아래 plnkr 소스를 참조.
angularjs에 directive라는 유용한 기능이 있다. directive가 생성되는 과정에는 compile과 link라는 과정을 거치게 되는데, compile에 경우 scope와는 상관없이 html에 대한 element 속성만 변경이 가능하다. 예를 들면 아래와 같이 반복되면서 파라미터 객체만 달리해야하는 html 태그가 있을때 사용하면 유용하다. 위와 같이 반복되는 html tag를 아래와 같이 디렉티브를 사용하여 쉽게 사용할수 있다. 자세한 샘플코드는 아래 plunker에서 확인하도록 하자. http://plnkr.co/edit/cJgfVG?p=info
angularjs typeahead는 ui-bootstrap에 포함되어 있습니다. 사용방법은 angularjs와 ui-bootstrap을 선언해주고input text에 uib-typeahead 선언해주면 사용할수 있습니다.module에서 ui-bootstrap 의 선언이 필요합니다. 제일 아래 jsbin에서 실제 코드를 테스트할수 있습니다. 다음 포스팅에서는 한글사용 문제와 해결방법에 대해서 포스팅 하도록 하겠습니다. html selected : {{selected}} jsangular.module("app",['ui.bootstrap']).controller("appCtrl",function($scope){ $scope.selected = ""; $scope.myData = [ {name:'abcd1'..
이클립스나 STS에서 톰캣서버 생성시 아래와 같은 에러 표시 및 만들어지지 않을경우 The currently selected server type does not support remote hostsWindow -> Preferences -> Server -> Runtime Enviroment로 들어가서 Tomcat을 Add 시켜준 후 생성하면 해결된다 . http://stackoverflow.com/questions/30568931/cannot-add-servertomcat-to-eclipse