简体   繁体   中英

KnockoutJS: Cannot read property 'fromJS' of undefined

I use KnockoutJS in my app. Today I've got an error Uncaught TypeError: Cannot read property 'fromJS' of undefined in browser console and page doesn't load, although I'm loading Knockout plugin and recently everything worked fine.

plugins from head

<script src="/assets/my/libs/knockout-2.1.0.js?body=1" type="text/javascript"></script>
<script src="/assets/my/libs/knockout.mapping.js?body=1" type="text/javascript"></script>

my javascript file

var IllustratorModel = function (data) {
  var self = this;
  window.komodel = this;
  this.pre_offerings = ko.mapping.fromJS(data);

  ....

Thanks!

今天我遇到了完全相同的问题..结果是淘汰赛-{version} .js被引用了两次。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM