ææãã§ã
ä¹ ã ã®ããã°ã«ãªãã¾ãã 3å¹´ã»ã©JavaScriptãå©ç¨ããéçºããã¦ãã¾ããããæåã¯ãªãJavaScriptã§MVCãã¬ã¼ã ã¯ã¼ã¯ãå¿ è¦ãªã®ããã¾ãã¡ããããããããã試è¡é¯èª¤ãã¦ãã¾ããã ä»æ¥ã¯ã¿ã¤ãã«ã®éãAngularJSãç´ æµã ãªã¨ãããã¨ãæ¸ãããã®ã§ããããããããã¹ããã©ã¯ãã£ã¹ã¿ãããªãã®ã§ã¯ãªããèªèº«ãã©ã®ããã«æèåè·¯ãçµç±ãã¦ããã«è¡ãçããã®ãã¨ããçµé¨è«ãè¨ãã¦ããããã¨æãã¾ãã ã¡ãªã¿ã«ç§ã®JavaScriptåã¯é«ãããã¾ããã®ã§ãããããã»ã»ã»ã jQuery æã ãJavaScript MV(V)Cã¿ãããªãã®ããªãã£ãæ代ãJavaScriptã§ãªãããªãã®ãä½ããã¨ãªãã¨jQueryãDojoã®ãããªä½ã¬ã¤ã¤ã¼ã®ãã¬ã¼ã ã¯ã¼ã¯ã主ã«å©ç¨ããã¦ãã¾ããã ãã®å½æç°¡åãªã·ã³ã°ã«ãã¼ã¸ã¢ããªã±ã¼ã·ã§ã³ãä½ã£ã¦ãã¾ãããç§ã¯jQueryãæ¡ç¨ãã¾
çãããããã«ã¡ã¯ãid:KenichiroMurataã§ãã ä»åã¯Knowledge Noteã«ã¦é£è¼ããã¦é ãã¦ãã ã試ãã¦å¦ã¶Backbone.jså ¥éããå ¨ï¼ååå ¬éãããããããã®ã¾ã¨ãããããã¨æãã¾ãã è¨äºã®ã³ã³ã»ãã ã¿ã¤ãã«ã«å«ããéããå®éã«ã³ã¼ããæ¸ãã¦è©¦ãã¦ã¿ããã¨ã§Backbone.jsã®ç解ãæ·±ãããã¨ãä¸çªã®ç®çã¨ãã¦ãã¾ãã ãªã®ã§ããã²å®éã«è¨äºã®ä¸ã«åºã¦ããã³ã¼ããæ¸ãã¦ãåããã¦ãã³ã³ã½ã¼ã«ã®ãã°ãåä½ã確èªãããã¨ããã¹ã¹ã¡ãã¾ãã åè¨äºã®æ¦è¦ 第ï¼å 試ãã¦å¦ã¶Backbone.jså ¥é Backbone.jsã®æ¦è¦ãããã¤ã³ã¹ãã¼ã«æ¹æ³ãModelãCollectionã®åºæ¬ã説æãã¦ãã¾ãã ç®æ¬¡ ã¯ããã« ã»ããã¢ãã Modelã®åºæ¬ Collectionã®åºæ¬ Collectionã®ä¾¿å©ãªé¢æ° 第ï¼å 試ãã¦å¦ã¶Backbone.
2013å¹´03æ21æ¥03:00 Backbone.jsã¯ã1.0ãã¤ã«ã¹ãã¼ã³ãåã ã«ãã´ãª mixiãã§ã㯠888æ¥å¾ãBackbone.jsã¯ããã¼ã¸ã§ã³1.0ã¸ã®åæã®ãªãªã¼ã¹ãã移è¡ãã¾ããã 1.0ã®ãªãªã¼ã¹ã¯ãã¢ãã«/ãã¥ã¼ââ/ãã¬ã¼ã³ã¿ã¼ã®JavaScriptãã¬ã¼ã ã¯ã¼ã¯ã® "ãã°ãã°ãç´æã®"ãã¼ã¸ã§ã³1.0ã¨ãã¦ã¸ã§ã¬ãã¼AshkenasãCoffeeScriptã®ã®ããä½æè ã«ãã£ã¦çºè¡¨ãããã æ¨å¹´ãéçºè ã¯ãã³ã¬ã¯ã·ã§ã³ãã¤ãã³ãã®mirrorable listenToã¯ãHTTP PATCHãªã¯ã¨ã¹ãã®ãµãã¼ããããã³æ°ãããã¼ã¿æ¤æ»æ©è½ã®ããã«æ´æ°ãã¹ãã¼ãã«è¿½å ããã Backbone.jsã¯åºãããªãã¡ã¯ã¿ãªã³ã°åçåãæé©åããã¦ãããliteratelyææ¸åããã¦ãã¾ãã Backbone.jsã¯ãæ¢åã®RESTfulãªJSON APIã«æ¥ç¶
context ã³ã¼ã«ããã¯é¢æ°ã®ä¸ã®thisãã¼ã¯ã¼ããæç¸ãã¾ãã object.off([events], [callback], [context]) è¨å®ããã¦ããã¤ãã³ããåé¤ãã¾ããå ¨ã¦ã®å¼æ°ãçç¥ããã¨ããªãã¸ã§ã¯ãã«è¨å®ããã¦ããã¤ãã³ããå ¨ã¦åé¤ãã¾ãã events åé¤ããã¤ãã³ãåã§ããåè§ã¹ãã¼ã¹ã§åºåã£ã¦è¤æ°ã®ã¤ãã³ãåãæå®ãããã¨ãã§ãã¾ããçç¥ããå ´åã¯nullã渡ãã¾ãã callback åé¤ããã¤ãã³ãããã³ã¼ã«ããã¯é¢æ°ã§æå®ãã¾ããçç¥ããå ´åã¯nullã渡ãã¾ãã context åé¤ããã¤ãã³ãããthis ã«æç¸ãã¦ãããªãã¸ã§ã¯ãã§æå®ãã¾ããçç¥ããå ´åã¯nullã渡ãã¾ãã object.trigger(events, [*args]) ã¤ãã³ããçºç«ãã¾ããã¾ããonã¡ã½ããã§è¨å®ããã³ã¼ã«ããã¯é¢æ°ã¸æ¸¡ãå¼æ°ãæå®ãã¾ãã ev
ããèªãã§ããr7kamuraåã«JSã®MVCã©ãããã®çãªè©±ãããã¦ãã®ãæãåºããã®ã§ãèªåãBackboneã使ãæã®ãã¿ã¼ã³ãr7kamuraåã®è¨äºããã¼ã¹ã«æ¸ããªããã¦ã¿ãã > ãµãã¯ã©ä¸¡æ¹ã§åã JavaScript ã®å¤§è¦æ¨¡éçºãè¡ãããã« â Gist https://gist.github.com/1362110 > client-side javascript - ââ¹â¡â¹â http://r7kamura.hatenablog.com/entry/2012/10/18/023629 以ä¸ã®æ§ãªã³ã¼ããæ¸ãããããªãåé·ã ããè¤éãªã¢ããªã ã¨ãããããã®åé·æ§ã¯å¿ è¦ã«ãªãã (ãªãæ¦å¿µãä¼ããããã®è§£èª¬ç¨ã³ã¼ããªã®ã§ãã®ã¾ã¾ããåããªã) Backbone.Model # åå空éã®åæå App = {} App.View = {} App.Model = {}
é²è¦§ä¸ã®æ³¨æ ãã®è¨äºã§å¯¾è±¡ã¨ãã¦ãããã¼ã¸ã§ã³0.5.3ã¯çµæ§å¤ãã®ã§æ³¨æãã¦ãã ããããã®è¨äºã§ããã°ãbindã¯ç¡ããªããç¾å¨ã§ã¯onãlistenToã使ããã¦ãã¾ãã ãã®ä»ã®å²ãã¨æ°ããæ å ±ã¯ Backbone.js Advent Calendar 2012 ãªã©ã«ããã¾ãã ï¼è¿½è¨ããã¾ã§ï¼ ãã¿åãæãå¦ããªãBackbone.js Advent Calendarã§ãããä»åããä½åãã«åãã¦æåä¸å¯§ãªå ¥éè¨äºãæ¸ãã¦ãããã¨æãã¾ãã 以ä¸ã®ããã«æ¸ãé²ãã¦ããäºå®ã§ãã Events View Model Viewã¨Modelã®é£æº Collection Viewã¨Modelã¨Collectionã®é£æº Routerã¨History ãªãããã§æ±ãBackbone.jsã®ãã¼ã¸ã§ã³ã¯0.5.3ã§ãã #Backbone.jså ¥é ãEventsã Backbone.js
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}