Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 21 21:15
    greenkeeper[bot] commented #5237
  • Sep 21 21:15

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Sep 21 21:12
    greenkeeper[bot] commented #5236
  • Sep 21 21:12

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Sep 21 03:58

    greenkeeper[bot] on @octokit

    (compare)

  • Sep 21 03:57

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Sep 20 21:04
    m-mujica commented #5303
  • Sep 20 20:23
    m-mujica opened #5303
  • Sep 20 20:23

    m-mujica on upgrade-deps

    Update can-type and can-stache-… (compare)

  • Sep 20 20:05
    m-mujica edited #5302
  • Sep 20 20:03
    m-mujica synchronize #5302
  • Sep 20 20:03

    m-mujica on upgrade

    Upgrade routing guide to Can 6 Fix incorrect highlight Use svg images (instead of .png) (compare)

  • Sep 20 19:32
    m-mujica opened #5302
  • Sep 20 19:29

    m-mujica on upgrade

    Upgrade routing guide to Can 6 Fix incorrect highlight (compare)

  • Sep 20 17:42

    m-mujica on upgrade

    WIP: Upgrade (compare)

  • Sep 20 17:06
    do-adams starred canjs/canjs
  • Sep 20 13:34

    chasenlehara on 5119-testing-guide

    Update the Testing guide for Ca… (compare)

  • Sep 20 13:21
    cherifGsoul commented #5295
  • Sep 20 13:18
    cherifGsoul synchronize #5295
  • Sep 20 13:18

    cherifGsoul on update-theme-new-buttons

    Theme pre-release 2 (compare)

Frank Lemanschik
@frank-dspeed
to use with your new apps can-route
Gregg Roemhildt
@roemhildtg
So, I saw ~your~ post earlier :point_up: July 25, 2017 9:35 AM but I've never seen routing done that way, I thought you just call route('/page/...');
sorry, not your post, but that one with the routes in the define map
Kevin Phillips
@phillipskevin
that doesn't work
@roemhildtg
thats the most big routing example that i know from can'js
so you need to add all values flat on the viewModel not nested
Gregg Roemhildt
@roemhildtg
That's helpful. I'm getting a better idea of how this should look
Frank Lemanschik
@frank-dspeed
your running exactly into what i was running in befor i understood that :)
Yeswanth Raghav T
@tyraghav

Hi All
I have a can.component element with tag person

<person {(mydetails)}="details"></person>
Where details is a can.model type
Where should I declare mydetails model in can.component in order to get the values of details to mydetails..??
In view model or As seperate variable in can.component or Inside define...??
How should I declare it..??
Anyone please help

Kevin Phillips
@phillipskevin
I would declare it in your viewmodel
look at how the messagesPromise is set up
Yeswanth Raghav T
@tyraghav
Ok
Thank you
Yeswanth Raghav T
@tyraghav
That example has no statement similar to one I mentioned above
Please help me with some other example
Frank Lemanschik
@frank-dspeed
assign it on the ViewModel right
or code a function that returns mydetails
Kevin Phillips
@phillipskevin
<person {(mydetails)}="messagesPromise.value"></person>
is how you would use that viewModel setup in your example
https://canjs.com/doc/guides/todomvc.html#Listtodos is an example where the value is passed to a component
Marc Godard
@MarcGodard
Hello... Can someone help me with You can't have two versions of can-event/batch/batch, check your dependencies error?
Kevin Phillips
@phillipskevin
run npm ls can-event
and figure out why you have two versions
if everything is the latest, they should all get the same version
@MarcGodard
Roger K
@thejavascriptist
Hi @phillipskevin ... went through some of the sample pages on the website re routing...

Tested the example from the url
https://canjs.com/doc/can-route-pushstate.html
Throws an error:
can-route.js:926 Uncaught Error: can.route.data accessed without being set
    at Function.get (can-route.js:926)
    at Compute.<anonymous> (can-route.js:902)
    at Observation.start (can-observation.js:264)
    at Compute._on (proto-compute.js:148)
    at Compute.<anonymous> (proto-compute.js:328)
    at Compute._eventSetup (can-observation.js:588)
    at Compute.prototype.addEventListener (lifecycle.js:27)
    at Function.addEventListener (can-compute.js:46)
    at Function._setup (can-route.js:828)
    at Function.ready (can-route.js:615)
The example from the url
https://canjs.com/doc/can-route.html
does not throw an exception but the route.data.on("page" ... ) or route.on("page" ... ) is never called.

    var DefineMap = require("can-define/map/map");
    var route = require("can-route");

    var AppViewModel = DefineMap.extend({
    page: "string"
    });

    var appState = new AppViewModel();
    route.data = appState;
    route('{page}', {page: 'home'});
    route.ready();

    route.data.on('page',function(ev, attr, how, newVal, oldVal) {
        console.log('route data - page', ev)
    })

    route.on('page',function(ev, attr, how, newVal, oldVal) {
        console.log('route data - page', ev)
    })
Went through the chat example on https://jsbin.com/yexezu/3/edit?html,js,output
Its not very clear how a the app would intercept the route change and proces it rather than a simple view updating itsself.
Kevin Phillips
@phillipskevin
ok, I think there's a few different problems...
the can-route-pushstate docs look to be a little out of date
Roger K
@thejavascriptist
ah
Kevin Phillips
@phillipskevin
there is already an issue about listening to routes changing
canjs/can-route#78
Roger K
@thejavascriptist
ha
Kevin Phillips
@phillipskevin
the last part I'm not sure exactly what you mean
what kind of processing do you want to do?
intercept the route change and proces it
Roger K
@thejavascriptist
The requirement that needs to be fulfilled is really simple:
The app must centralize the registering and any processing of a route change to a single function.
The app must accept a url pattern "/aa/{sid}/bb{mid}/cc/" or "/xx/{sid}/bb/{id}"...
There are 30+ url paths, when the location hash is changed, it must trigger a single function which validates security and calls the appropriate component/controller.
(the function may be added n number of times to route.on("sid", fnHandleRouteChange ) route.on("mid", fnHandleRouteChange ) etc... )
...
also the usage of defineMap seems to be an overkill for the purpose based on teh example in the jsbin
adding a simple route('pattern/prop', handler) multiple times should be sufficient?
Kevin Phillips
@phillipskevin
the purpose of can-route is to bind the url to an observable map