2013å¹´2æ25æ¥(æ) ã«éå¬ããã¾ãã TechBuzz 第4å.jsç³»éçºæè¡åå¼·ä¼ã§çºè¡¨ããã¦ããã ãã¾ããã¹ã©ã¤ãã«ãªãã¾ããå 容㯠Backbone.js ã®å ¥éã¨ãªã£ã¦ããã¾ããRead less
Backbone.jsãã¯ããã¨ãã¦ãã³ã¼ãã®æ§é ãä¿å®ã®å®¹æããåä¸ããã¦ãããJavaScriptãã¬ã¼ã ã¯ã¼ã¯ã人æ°ã§ããæ¬æ¸ã®è§£èª¬ã¯ãMVCã«ãã£ã¦æ§é åãããJavaScript SPAã¢ããªã±ã¼ã·ã§ã³ãä½æããæ¹æ³ãªã©ãBackbone.jsã«ã¤ãã¦ã®åºç¤çãªäºæã«ã¨ã©ã¾ãã¾ãããã¢ã¸ã¥ã¼ã«å½¢å¼ã®éçºããã¾ãã¾ãªãã©ã°ã¤ã³ã®ç´¹ä»ãéçºè ãããééããåé¡ã¸ã®è§£æ±ºçãã¢ããªã±ã¼ã·ã§ã³ã®éª¨çµã¿ã®èªåçæãã¦ããããã¹ãã«è³ãã¾ã§ãBackbone.jsã¢ããªã±ã¼ã·ã§ã³éçºã®ãã¾ãã¾ãªå±é¢ãå¤è§çã«ã¨ãããä¸åã§ãã ã¾ããã 1ç« ãã¤ã³ãããã¯ã·ã§ã³ 1.1ãMVCã¨ã¯ 1.2ãBackbone.jsã¨ã¯ 1.3ãJavaScriptã®MVCãã¬ã¼ã ã¯ã¼ã¯ãå¿ è¦ã«ãªãã¨ã 1.4ãBackbone.jsãæ¤è¨ããã¹ãçç± 1.5ãæ¬æ¸ã®æ§æ 2ç« ãMVC 2.1ãMVCã¨ã¯ 2.1
Todoãªã¹ãã®æ©è½ 1.ããã¹ãããã¯ã¹ãããEnterã§è¿½å ã§ãã 2.ç»é²ããTodoã¯ããã«ã¯ãªãã¯ã§ç·¨éå¯è½ã«ãªããEnterã§ç·¨é確å®ã§ãã 3.ç»é²ããã¦ããTodoã®ç·ä»¶æ°ãããã¿ã¼ã«è¡¨ç¤ºããã 4.å®äºããTodoãããå ´åããããããªã¹ãããæ¶ããã¿ã³ã表示ããã 5.å ¨é¸æ/解é¤ãè¡ããã§ãã¯ããã¯ã¹ããã å人çãªçµè« 趣å³éçºã§ä½¿ããªãAngular.jsã»ä»äºã§ä½¿ããªãKnockout.jsããå§ããããã ã¾ãããã¬ã¼ã ã¯ã¼ã¯ãé¸æããéã¯ã以ä¸3ã¤ã®é¸æåºæºãæã¤ã¨ããã¨æãã 1.éçºã®è¦æ¨¡ 大è¦æ¨¡ãªãBackbone.jsã¯ãå§ãã§ããã æ¸ãæ¹ã決ã¾ã£ã¦ãã¦ããã¥ã¼ããªã¢ã«ã«ç®ãéãã°(é¢åãªã®ã¯ç½®ãã¦ããã¦)ä½ãä½ããªããã°ãªããªããã¯ç°¡åã«ç解ã§ãããããããã®äººæ°ã§é·ãæéã®éçºãè¡ããªããUIãã¼ã ã¯ã¢ããªã±ã¼ã·ã§ã³ã¨Viewããµã¼ãã¼ãµã¤ãã¯
object.once(events, callback, [context]) object.listenTo(other, event, callback) object.stopListening([other], [event], [callback]) Backbone.Model Backbone.Model.extend([properties], [classProperties]) Backbone.Modelããç¶æ¿ããæ°ããã¢ãã«ãä½ãã¾ãã properties ã¤ã³ã¹ã¿ã³ã¹ã¡ã³ããå®ç¾©ãã¾ãã var User = Backbone.Model.extend({ say: function () { console.log("Hello."); } }); var user = new User(); user.say(); //-> Hello. classPr
jQueryããã¼ãªã¢ããªã±ã¼ã·ã§ã³ã®åé¡ç¹ã¨ãMVCã«ããæ§é åã®å¿ è¦æ§ jQueryã¯ããã©ã¦ã¶ä¸ã§åãJSã¢ããªã±ã¼ã·ã§ã³ã®éçºçç£æ§ãåçã«åä¸ããã¾ãããDOMæä½ã«ããåçãªãã¼ã¸æ¸ãæãå¦çãªã©ã¯ãã»ã¬ã¯ã¿ã使ã£ã¦ã¡ããã£ã¨ã³ã¼ããæ¸ãã ãã§ãã»ãã®æ°è¡ã§è¨è¿°ã§ãã¦ãã¾ãã¾ãã ãããããã®æ¹æ³ã®å»¶é·ã§ã大è¦æ¨¡ãªJSã¢ããªã±ã¼ã·ã§ã³ãæ§ç¯ãããã¨ã¯æããã¦ç¾å®çã§ãããããä¾ãã°ãGMailãããNew Twitterãç¨åº¦ã®è¦æ¨¡ã®JSã¢ããªã±ã¼ã·ã§ã³ãæ¸ããªããã°ãªããªãã¨ããããã©ãã§ãããï¼ å¤§è¦æ¨¡ãªJSã¢ããªã±ã¼ã·ã§ã³ãéçºããã«ã¯ããããã£ãææ³ã延é·ããã®ã§ã¯ãªããããæ´ç·´ããããã¶ã¤ã³ãã¿ã¼ã³ãå°å ¥ããå¿ è¦ãããã¾ãããã®ç®çã«ã´ã£ããã®ãã¶ã¤ã³ãã¿ã¼ã³ãããMVCããã¶ã¤ã³ãã¿ã¼ã³ã§ãã MVCãã¿ã¼ã³ã¯ãWebã®ä¸çã§ã¯ãµã¼ããµã¤ãããã°ã©ãã³ã°ã§åºãç¥ãã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}