Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:45
    greenkeeper[bot] labeled #5387
  • 12:45
    greenkeeper[bot] opened #5387
  • 12:45

    greenkeeper[bot] on can-stache-element-1.0.2

    fix(package): update can-stache… (compare)

  • 09:49
    chasenlehara edited #5384
  • 09:47
    chasenlehara edited #3864
  • 09:46
    chasenlehara edited #5383
  • Oct 17 20:12

    matthewp on master

    Update dist for release (compare)

  • Oct 17 20:12

    matthewp on v6.1.2

    Update dist for release 6.1.2 (compare)

  • Oct 17 20:04

    matthewp on master

    Update dist for release (compare)

  • Oct 17 20:04

    matthewp on v6.1.2-0

    Update dist for release 6.1.2-0 (compare)

  • Oct 17 19:17
    akbaruddin starred canjs/canjs
  • Oct 17 17:25
    matthewp edited #5384
  • Oct 17 17:00

    matthewp on can-dom-mutate-2.0.7

    (compare)

  • Oct 17 17:00

    matthewp on master

    fix(package): update can-dom-mu… Merge pull request #5386 from c… (compare)

  • Oct 17 17:00
    matthewp closed #5386
  • Oct 17 16:27
    greenkeeper[bot] labeled #5386
  • Oct 17 16:27
    greenkeeper[bot] opened #5386
  • Oct 17 16:27

    greenkeeper[bot] on can-dom-mutate-2.0.7

    fix(package): update can-dom-mu… (compare)

  • Oct 17 16:25

    matthewp on can-dom-mutate-2.0.6

    (compare)

  • Oct 17 16:24
    matthewp closed #5379
Kevin Phillips
@phillipskevin
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
Roger K
@thejavascriptist
using pushstate or #! are both ok, urls looking like &aa=sid&bb=mid is not.
would an observable map be https://canjs.com/doc/can-map.html
Kevin Phillips
@phillipskevin
yes, or DefineMap
there is an example on https://canjs.com/doc/migrate-3.html for how to listen to when any property changes
Roger K
@thejavascriptist
it was mentioned somewhere that can-map was being deprecated so do not use it?
Kevin Phillips
@phillipskevin
search for Remove use of change events
it's not deprecated
but it is a legacy api
DefineMap does everything can-map does, but you don't need to call .attr()
to get/set properties
Roger K
@thejavascriptist
oic - Remove use of change events
When you upgrade to use can-define, you’ll no longer receive change events on maps.
is there a working example of a can-route-pushstate that we could test?