Skip to content

Backbone.jsを使ったチュートリアルを作って見ました。まだRouterとViewのEventsを使ったときの流れが分からない!

Notifications You must be signed in to change notification settings

hisasann/BackboneTutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backbone.jsを使ったチュートリアル

使用ライブラリ

CoffeeScript、jQuery、node.js、Backbone.js、Underscore.jsを使いました。

CoffeeScriptのコンパイルにはgrunt.jsを使いました。

Zepto.jsを使おうと思っていたんですが、

$('a[href^=#]')

このセレクターがZepto.jsだと使えないので、jQueryに切り替えた。

jQuery独自セレクターの恩恵を実感!

Backbone.Routerの気をつける点

Router = Backbone.Router.extend
  routes:
    '': 'root'
    'foo/:hoge': 'foo'

のように''というルートを入れておかないと、初めのURLに戻ってきたときにイベントがfireされない。

chapter1 - Eventsのサンプル

chapter2 - templateを使ったrenderのサンプル

chapter3 - Modelのサンプル

chapter4 - ViewとModelの連携のサンプル

chapter5 - Routerのサンプル

chapter6 - Model、View、Routerの連携のサンプル

About

Backbone.jsを使ったチュートリアルを作って見ました。まだRouterとViewのEventsを使ったときの流れが分からない!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published