Reputation: 24979
js / chaplin.js and I'm having some dificulties to find documentation about the chaplin routes.
I have the following code (cofeescript), it works in chrome but in firefox it tries to navigate doing a request to the server and it returns a 404 error. The server side is an ASP MVC 3 project.
Routes define -> 'use strict' (match) -> match '', 'page#home' match 'Home', 'page#home' match 'Services', 'page#services'
PageController
define [
'controllers/base/controller',
'views/home_view',
'views/services_view'
], (Controller, HomeView, ServicesView) ->
'use strict'
class PageController extends Controller
historyURL: (params) ->
''
home: (params) ->
@view = new HomeView()
return
services: (params) ->
@view = new ServicesView()
return
Navbar (HTML)
<a href="Home">Home</a>
<a href="Services">Services</a>
PS: Another thing that I would like to know is, when the controller is called:
define [
'controllers/base/controller',
'views/home_view',
'views/services_view'
], (Controller, HomeView, ServicesView) ->
'use strict'
This is loading with AJAX both the Home and service view I would like to load only the one that has been actually called?
Thanks for your help.
Upvotes: 0
Views: 1723
Reputation: 2913
Already answer on https://github.com/chaplinjs/chaplin/issues/180
Upvotes: 1