Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 11 09:54
    Jan-Thes edited #2593
  • May 11 09:52
    Jan-Thes opened #2593
  • May 08 08:08
    mbest commented #2445
  • Apr 30 10:39
    wahur666 commented #2445
  • Apr 30 10:37
    wahur666 commented #2445
  • Apr 26 08:54
    phil-warner commented #2319
  • Apr 26 08:53
    phil-warner commented #2319
  • Apr 22 15:17
    soruban commented #1432
  • Apr 22 15:16
    soruban closed #1432
  • Apr 19 17:54
    jfrank14 opened #2592
  • Apr 19 17:48
    vrad-joshuamckelvey opened #2591
  • Apr 06 11:21
    Azgmohammadd opened #2590
  • Mar 26 20:55
    mbest closed #2585
  • Mar 26 20:55
    mbest commented #2585
  • Mar 12 02:15
    mbest commented #2589
  • Mar 12 02:12
    mbest commented #2589
  • Mar 08 13:10
    tomhanax edited #2589
  • Mar 07 19:12
    tomhanax commented #2589
  • Mar 07 19:11
    tomhanax commented #2589
  • Mar 07 19:07
    tomhanax edited #2589
theDPlayer
@theDPlayer
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",
Mark Carpenter Jr
@mcarpenterjr
I have an issue with the text binding, if I do text: myobservable().prop the text binds to the element but it throws an 'undefined' error in the console. If I do text: myobservable.prop I don't get the undefined error but the text doesn't bind. Any thoughts?
Nelson Amador
@rod6214
text: myobservable
Mark Carpenter Jr
@mcarpenterjr
@rod6214 myobservable contains json/
Eric Morton
@xec
If it’s a json string (as opposed to a js object) you’d need to parse it first. I recommend you do that in the viewmodel code after fetching data, instead of directly in the binding, but it could look something like this: text: JSON.parse(myobservable()).prop
Emilian Ionascu
@emilianionascu
Hi, we're trying to upgrade from 3.4.2 to 3.5.1 but so far we've been unsuccessful. It looks like it's the foreach changes that were implemented thus the knockout context not being created properly. Is this a known issue?
Dylan Evans
@dylan-evans
Hi all, i don't see much activity on the repo, is knockout dead?
:( i hope not
Dexter Miguel
@divmgl
@dylan-evans i haven't used knockout since 2011. i'm surprised anyone is still using it
this example is bugged in safari: https://knockoutjs.com/examples/helloWorld.html
Daniel Dickison
@danieldickison
That example seems to be working fine for me on Safari here. What do you see?
fwiw my team adopted knockout in 2011 or 2012 and we’ve been using it very heavily ever since then. We recently migrated to tko to disallow eval with CSP.
Kenneth
@recypher-zz
Hi, it's my first time using Knockout, and I'm still relatively new to nodeJS, I installed it via npm, but how do I go about including it into the pages to run the JS I write in them?