Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 04 09:59
    AadilMehrajBhat commented #914
  • Mar 04 03:11
    anticomputer closed #2562
  • Mar 02 16:49
    anticomputer commented #2562
  • Feb 28 05:42
    mbest commented #1448
  • Feb 28 05:30
    mbest closed #1970
  • Feb 28 05:30
    mbest commented #1970
  • Feb 28 05:22

    mbest on master

    Convert function declaration in… Merge pull request #2133 from C… (compare)

  • Feb 28 05:22
    mbest closed #2133
  • Feb 28 05:19
    mbest closed #2186
  • Feb 28 05:13
    mbest closed #2329
  • Feb 28 05:09
    mbest commented #2420
  • Feb 28 05:09
    mbest commented #2420
  • Feb 28 05:09
    mbest closed #2420
  • Feb 28 05:07

    mbest on master

    Remove not needed command from … Merge pull request #2556 from k… (compare)

  • Feb 28 05:07
    mbest closed #2556
  • Feb 28 05:06
    mbest commented #2394
  • Feb 28 04:58
    mbest closed #2394
  • Feb 28 04:51
    mbest closed #2482
  • Feb 28 04:51
    mbest commented #2482
  • Feb 28 04:50
    mbest labeled #2476
Casey Webb
@caseyWebb
I'd try target es2015 just to rule it out, but that should work afaict
Micah Zoltu
@MicahZoltu
It compiles down to a property set in the constructor to a field on the class.
And the same thing works in a KO if block.
<!-- ko if: myAccount -->
changed to
{{#if myAccount}}
Otherwise code untouched.
Casey Webb
@caseyWebb
that's curious, as punches just rewrites the binding and passes it on to KO. maybe double check closing tags? I'm kind of at a loss, just throwing things out there
Micah Zoltu
@MicahZoltu
{{/if}}
Casey Webb
@caseyWebb
I meant unterminated blocks within the if binding. I've seen some funky errors thrown when that happens.
Micah Zoltu
@MicahZoltu
Just checked diff, the change from KO comment to Punches curlies were the only changes, and each was a single line.
Just reverted that one change and problem went away.
Casey Webb
@caseyWebb
:/ yea I'm not sure what is happening
theDPlayer
@theDPlayer
hi,
getting this error in knockout.js
Uncaught Error: ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node
    at a.uc (vendor.js:21782)
    at Object.a.applyBindings (vendor.js:21847)
    at portfolio.js:35
Andrew Vickers
@avickers
@theDPlayer You’re the second person to report this error in the past few days while following a tutorial. When I test it out in Codepen, it works for me. What version of Knockout are you using, and where are you getting it from?
@caseyWebb Hope the tornado didn’t affect you
Andrew Vickers
@avickers
Oh, and what bundler are you using with what configuration? The fact the the error is being thrown by vendor.js makes it seem like a Webpack/Babel issue
My suggestion is to create your ViewModels as regular Objects rather than Functions that you instantiate, as something in the transpilation appears to be causing that to go sideways. If you can confirm that, then it might be a good idea to update the documentation.
Casey Webb
@caseyWebb
@theDPlayer use ko.applyBindings(myViewModel, document.body)
the second parameter is no longer optional iirc
@avickers all well, thanks for the sentiment :smile:
theDPlayer
@theDPlayer
@caseyWebb , thanks. @avickers latest version.
theDPlayer
@theDPlayer
how do you bind something like this in this.
<div class="currency"><span>upwared </span><span>size</span>currency</div>
in this, upward, size and currency is dynamic text, and no, they are not nested
Andrew Vickers
@avickers
Jaxcoder
@codenamejason
@theDPlayer <span data-bind="value: upward">... so on. In your view model set the values to ko.observables like self.upwared = ko.observable()
LMAO, just realizing how old this is LOL
Emilian Ionascu
@emilianionascu
Anyone else still using KO in production?
Mark Carpenter Jr
@mcarpenterjr
Yea, I have a couple apps that depend on it.
Silviu Bogan
@silviubogan
Hello! Is there any way to use KO with ES6 import syntax or should I start using KO 4? Thank you.
Nelson Amador
@rod6214
Hello there!!!!, is KO still alive?
myunuskabir
@myunuskabir
Hi Experts..I am a newbie to KO..The tutorials say that a ViewModel Object is passed to ko.applyBindings. However, in some code instances I see the function value itself passed. Can someone please explain?
For example: function DashboardViewModelTest() {
//properties
return DashboardViewModelTest;
}
Brett Ryan
@brettryan

@theDPlayer for your template you could achieve it like this.

<div data-bind="with: citem">
  <div data-bind="class: currency">
    <span data-bind="text: upward"></span>
    <span data-bind="text: size"></span>
    <!-- ko text: currency --><!-- /ko -->
  </div>
</div>

then in your model if you had the following:

self.citem = ko.mapping.fromJS({
  currency: 'AUD',
  upward: 'Upward',
  size: 200
});
pim
@pimbrouwers

Anyone else still using KO in production?

I stopped a few years ago when my company was on a mission to reduce bundle size. We use mithril now for all greenfield work. But I miss knockout immensely.

Valter
@valterex
hey, anyone know any good resources for learning KnockoutJS + Redux? Coming from React/Redux background...
Adalyat Nazirov
@AdalyatNazirov
hello
is there any plans for Knockout 4.0 release date?
Ankit Solanki
@ankitsolanki
hello - any knockout freelancer here?
please write to me at ankit@digihealth.in
have a memory lead issue due to oberservableArray
richardtans
@richardtans
hi experts, could you please help me?
so I have an Observable Array, and in the UI i bind it using foreach
when i click a button it trigger an ajax call but the UI is not refreshed
i have tried many thing but the UI doe not seems to change
is there anyway to reapply knockout bindings?
richardtans
@richardtans
self.DeleteRuleSet = function (){
var ruleSetId = self.ruleSetId();
$.ajax({
type: "DELETE",
dataType: "json",
async: false,
url: baseUrl + "RuleSet/DeleteRuleSet?rulesetId=" + ruleSetId,
success: function (data) {
if (data.isSuccess) {
$("#deleteModal").hide();
var data = self.RuleSetList();
data = data.filter(function (ele) { return ele.RuleSetId() != ruleSetId });
self.RuleSetList(data);
}
}
});
}
this is what i did but the UI did not get updated
Eric Morton
@xec
@richardtans
data is ambiguous inside the success callback - both a parameter name (ajax response) and a var (self.RuleSetList()).
also, you probably don't want to use jQuery's .hide() when using ko - try the visiblebinding instead
amp
@axp215_twitter
hello, is there a quick/easy way to switch an existing app from minifying to the debug knockout? I'm not finding a clear flag to change it, and continue to see minified knockout when tracing up from application code... how can I set the app to run with the ko..debug.js instead of just the regular/latest ko js?
amp
@axp215_twitter
is it necessary to setup the project and modify the grunt steps (if already configured for minified), to instead point to, say, a local debug.js file instead of the node_modules..minified knockout js? or is it possible to include the debug version here "dependencies": { ... "knockout": "^3.5.1",?
amp
@axp215_twitter
nvm, i figured it out today, changing package json to a local copy works "knockout": "file:~/git/local-dependencies/knockout-3.5.1.debug.js",