Code Monkey home page Code Monkey logo

mmrouter's Introduction

mmRouter

avalon的三柱臣之一( 路由,动画,AJAX)

如何运行GITHUB中的例子(不包括avalon_spa_example.rar)

需要执行npm install命令,安装Express 3.x 和它的依赖,location:3000

如何avalon_spa_example.rar示例

这是一个没有后台的SPA例子,请解压后,安装netBeans,新建项目,选择“基于现有源代码的HTML5应用程序”,指定解压目录, 然后点IDE的运行

路由器的相关API

http://rubylouvre.github.io/mvvm/avalon.router.html

路由器与多个VM的协作(每个VM定义在不同的JS文件中)

```javascript

//aaa.js define("aaa", function(){ return avalon.define("aaa", function(vm){ vm.path = "/aaa"

})

})

//bbb.js define("bbb", function(){ return avalon.define("bbb", function(vm){

}) })

//ccc.js define("ccc", function(){ return avalon.define("ccc", function(vm){

}) })

//页面 require(["mmRouter", "aaa", "bbb", "ccc"], function(avalon, av, bv, cv){ avalon.router.get("/aaa", function(a) { av.path = a }) avalon.router.get("/bbb", function(a) { bv }) avalon.router.get("/ccc", function(a) { cv })

avalon.history.start({
basepath: "/mvvm"
})
 avalon.router.navigate("/aaa")
avalon.scan()

})

thanks to  sammy, jquery-address, backbone.js,angular.js
以后要学习一下 director

mmrouter's People

Contributors

csbun avatar rubylouvre avatar shuxiang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.