[AngularJS] routeProvider 에서 resolve Error   H 3000

angularJS 에서보통 routeProvider 를 사용해서 사용하는데.사용시 비동기 방식을 위해 resolve 를 사용합니다.app.jsmyApp.config(['$routeProvider',function($routeProvider) {$routeProvider.when('/list',{templteUrl : 'list.html',controller : 'listCtrl',resolve: {data : function(Svc){return Svc.query();}}}).otherwise({redirectTo : '/list'});})controller.jsmyController.controller('myController',['$scope','data',function($scope,data) {$scope.list = data;...

[AngularJS] Tutorial 및 게시판 Demo   H 39000

요즘 프론트엔드 프레임워크로 각광을 받고 있는 AngularJs를 한번 해보았다.아물론 나에게만 다른사람들은 일찌감치 사용하는거 같음.음.. 처음에는 뭔가 쫌 어색했는데 하다보니 뭐.. 괜찮은듯.싱글페이지 만들때는 정말 유용하게 사용할수 있을듯 함.http://www.angularjs.org 에서 Tutorial을 그대로 따라해 보고바로 간단한 게시판을 만들어 봄.생각보다 간단하고(물론 깊숙히 해보진 않음..ㅜ) 쉽게 되는듯조금만 익숙해 지면 괜찮게 사용이 가능할듯 하다.조금더 ...

javascript 에서 replaceAll 기능구현   H 3000

javascript 에서 replace 기능은 단어 하나만 바꿔준다.예를 들어var str = '2015-05-24';str.replace('-','.');//결과2015.05-24위와 같이 하나만 바꿔준다 그래서 따로 함수를 만들어서 사용해야함/* replaceAll*/ String.prototype.replaceAll = function(org, dest) { return this.split(org).join(dest); }위처럼 프로토 타입으로 만들어 주고 replace 사용할때처럼 똑같이 사용해 주면 끝.

javascript keycode (IE,Chrome)   H 3000

javascript 에서 keycode 값 알아내기if (window.event){ //IE     keycode = window.event.keyCode; }else if (e){ //Chrome     keycode = e.which; }console.log("keycode:"+keycode);keycode 값이 나오면 이제 그 키보드 코드별로 할일을 만들면 됩니다.예를 들면 keycode 값이 13이면 엔터를 친거니깐 뭐 submit 을 하던가 하는.

모바일(휴대폰)접속에 따른 페이지 이동   H 3000

모바일로 싸이트에 접속시 자동으로 이동 시켜주기function mobile_redirect(sMobileUrl, oParam) { 'use strict'; try { var sCurrentUrl = location.href; var sUrlSearch = document.location.search; if (sUrlSearch.indexOf('pc_v=true') < 0) { if ((navigator.userAgent.match(/(iPhone|iPod|Android.*Mobile)/i))) { oParam = (undefined === oParam) ? false : oParam ; if (oParam) { var sPageLayout = '<!DOCTYPE html><html><head...

input 박스에서 focus 자동이동   H 24000

글자 입력후 포커스가 다음 input 박스로 자동으로 이동되는 소스- jQuery$(function() { $(".inputs").keyup (function () { var charLimit = $(this).attr("maxlength"); if (this.value.length >= charLimit) { $(this).next('.inputs').focus(); return false; } }); });-html<input type='text' class='inputs' maxlength='3' />-설명input 박스에 클래스명을 inputs 라고 넣고 maxlength 만큼 글이 입력되...

jQuery 이미지(img) 넓이(width)와 높이 구하기(height)   H 31000

이미지 넓이랑 높이 구하는 법.$(document).ready(function(e) { $("img").each(function() { $(this).load(function(){ //이미지를 다 불러온후 확인하기 위해 var imgWidth = this.naturalWidth; //이미지 크키가 정해져 있지 않을때 var imgWidth2 = $(this).width(); //이미지 크키가 정해져 있을때  }); });});우선 코드는 위와 같음.포인트만 2개 잡아 보자면 첫번째 포인트  $(this).load(function(){ 이부분이 될수 있겠다. 그냥 $(this...

jQuery 달력(datepicker) 특정날짜 비활성화(disable) 시키기   H 20000

많이들 사용하시는 jQuery 달력입니다.달력사용할때 특정 날짜를 비활성화 한다던가 아니면..특정날짜만 사용하게 하는등 그런 부분이 필요할때 사용하는 법입니다.우선 기본적으로 jquery파일은 기본이고 ui 파일도 다운받아야 합니다.싸이트 http://jqueryui.com/download/all/ 에 가면 받을수 있습니다.사용법jQuery(function($){ /* //config 값을 json형식으로 만든후 setDefaults로 설정할수도 있음. $.datepicker.regional['ko'] = {closeText: '닫기',dayNames...

[carouFredSel] 이미지 slide(rolling) jQuery 플러그인   H 4000

아직 사용은 안해봤는데...그냥 봤을때는..뭐 괜찮아 보임... 데모페이지 가서 보니깐 쓸만한거 같음.!!쓸일 생기면 써봐야겠음. carouFredSel_6.2_.1_.zip

jquery touchSlider   H 3000

jquery.touchSlider_.zip- 출처 : http://dohoons.com/