These are chat archives for canjs/canjs

12th
Feb 2019
apsignifi
@apsignifi
Feb 12 14:27
okk. thanks.
apsignifi
@apsignifi
Feb 12 14:40

can3: I have application version set in package.json like this :

  "version": "2.3.16",

how do I get the value of verison in my application (i want to display it to the user) ?

Kevin Phillips
@phillipskevin
Feb 12 14:45
can you just import package.json @apsignifi?
apsignifi
@apsignifi
Feb 12 14:49
not sure how to do that
<can-import from 'package.json'> ??
or import version from 'package.json' ?
Kevin Phillips
@phillipskevin
Feb 12 15:46
import pkg from "package.json";
const version = pkg.version;
Piyush Sharma
@Piyush5767
Feb 12 16:18
Hi how can i get base url in canjs 3?
Piyush Sharma
@Piyush5767
Feb 12 16:59
any suggestions, i have tried to use var baseUrl = require("can-globals/base-url/base-url");
but it gives me full path, i don't want to use window.loaction.hostname
apsignifi
@apsignifi
Feb 12 18:02
import pkg from "package.json";
const version = pkg.version;
@phillipskevin : Thanks.
apsignifi
@apsignifi
Feb 12 18:25

can4:

stache.registerHelper("pageComponent", function(options) { 
    var pageComponent = options.context.pageComponentConfig;

in stache, I am using the helper like this:

{{{pageComponent}}}

I am getting an error saying options.context is undefined . between can3 && can4 , is there a syntax change in the stache files which may be causing this ?

Chasen Le Hara
@chasenlehara
Feb 12 22:20
@Piyush5767 What’s the reason for not using window.location?
@apsignifi I think you’ll want to use a call expression {{{pageComponent()}}}
Chasen Le Hara
@chasenlehara
Feb 12 23:29
BTW, today’s the last day to participate in our latest community survey: https://www.surveymonkey.com/r/bitovi-feb-2019