2014/1/22 gooã©ãopen tech talkã§è©±ããBackbone.jsã¨Marionette.jsã®è©±ã§ããRead less
Marionette.jsã®Viewå¨ãã«ã¤ãã¦ãä¸å¿ã«Single Page Applicationãä½ãã¨ãã®è©±
Backbone.jsã§ãã¼ã¸é·ç§»ãè¡ãã¨ããä»ã¾ã§ä½¿ã£ã¦ããViewã¯ã©ãã«è¡ã£ã¦ãã¾ãã®ã ãã®è¬ã¯åãã«ã解æã§ãã¦ããªããã ãã³ãã¯ãBackbone.jsã¯Viewã®ä½¿ãæ¹ã«ã¤ãã¦ã¡ã¢ãªç®¡çæ©æ§ããã£ã¦ãªãã®ã§ãæ確ã«éæ¾ããªãã¨ã¡ã¢ãªãå§è¿«ããããäºæããªãåä½ãèµ·ãããããããã¨ããã ãã¾ãã¾ããããªç¾è±¡ãã«ã¡ã©ã«æ®å½±ã§ããã®ã§è¦³ã¦ããããã ããã¯ã³ã¬ã¯ã·ã§ã³ã¸ã®addã®ç£è¦ãï¼éãï¼éã«è¨å®ããã¡ããã®ã§èµ·ãã£ã¦ãã£ã½ãç¾è±¡ ãããã£ããã¨ãé¿ããã«ã¯ç°¡åã§è¨å®ãã¦ãã¤ãã³ãé¡ãã¡ããã¨éæ¾ï¼(unbind)ãã¦ãã次ã®åä½ã«ç§»ãã°ãã éæ¾ãããã®ã¯ï¼ã¤ããããã£ã¦ãï¼.DOMã¨2.ããã«æ¸¡ãããã¢ãã«ãã³ã¬ã¯ã·ã§ã³ã®ã¤ãã³ãã3.viewç¬èªã®ã¤ãã³ãï¼ã¤ãã³ãããã·ã¥ã§ãã¤ã³ãããã¤ãã³ãï¼ã DOMã®éæ¾ã¯ä¸çªç°¡åã§
æ¨æ¥ã®ã¨ã³ããªã®ç¶ãããã£ã¡ã®ã»ããæçãªæ å ±ã«ãªã£ã¦ãã¨æããã ãã©å¤åæ¨æ¥ã»ã©ã¯ã®ã³ãªãã ãã¦ãæ¨æ¥ã®ã¨ã³ããªã¼ã§ã¯ãBackbone.jsã®Viewã¯Controllerã£ã¦ãã¨ãªã®ããããã¯ä¿ºãééãã¦ãããããã£ããã Marionette.js 使ãå ´åã¯ã©ããªã®ãã¨ããæãã«ãªã£ãã®ã ããã©ããã®ãã¨ããããèãã¦ä»¥ä¸ã®ãããªæãã«è½ã¡çããã Marionette.jsã使ã£ã¦ããã¨ãã¦ãçµå±èãæ¹ã¯Backbone.jsã®ã¨ãã¨ããããªãã ã¤ã¾ããMarionette.js ã® View ã C ã§ãããViewControllerã¨è¨ãã¹ããããããªãã®ã§ä»¥ä¸ã§ã¯ViewControllerã¨æ¸ãã ViewControllerã®è²¬åã¯ã以ä¸ã®éãã§ããã Model(ãããã¯Collection)ãã²ã¨ã¤ä¿æããView(HTMLçã®ãã¨ã§ãã)ãã²ã¨ã¤ä¿æãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}