gpt4 book ai didi

javascript - "TypeError: Cannot read property ' jqcloud中默认' of undefined"

转载 作者:行者123 更新时间:2023-11-28 06:07:34 25 4
gpt4 key购买 nike

我正在使用jqcloud指示。我遵循了文档中描述的所有步骤。但仍然不起作用。

我的代码:

HTML

<div class="item" href="/clients"></div>

<ion-content ng-controller="clientsController as clients" style="margin-top: 25px">

<div class="demo">

<jqcloud words="clients.words" width="500" height="350" steps="7"></jqcloud>
</div>

JS:

    angular.module('starter.clientsController', ['ionic', 'angular-jqcloud'])
.controller('clientsController', function ($scope){

$scope.words = [{text: "Lorem", weight: 13},
{text: "Ipsum", weight: 10.5},
{text: "Dolor", weight: 9.4},
{text: "Sit", weight: 8},
{text: "Amet", weight: 6.2},
{text: "Consectetur", weight: 5},
{text: "Adipiscing", weight: 5},];

});

更新:

问题是我没有添加 jqcloud.js 文件,我只添加了包装器。现在,我没有收到错误,但收到一个空白页。

最佳答案

您已使用#demo id,但从未在 HTML 代码中使用过:请尝试以下操作:

  <div class="item" href="/clients"></div>
<ion-content ng-controller="clientsController" style="margin-top: 25px">
<div id='demo' width="500" height="350" steps="7"></div>
</ion-content>

Angular 部分:

angular.module('starter.clientsController', ['ionic', 'angular-jqcloud'])
.controller('clientsController', function ($scope){

$scope.words = [{text: "Lorem", weight: 13},
{text: "Ipsum", weight: 10.5},
{text: "Dolor", weight: 9.4},
{text: "Sit", weight: 8},
{text: "Amet", weight: 6.2},
{text: "Consectetur", weight: 5},
{text: "Adipiscing", weight: 5},];

$('#demo').jQCloud($scope.words);
});

关于javascript - "TypeError: Cannot read property ' jqcloud中默认' of undefined",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36692865/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com