作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用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/
我是一名优秀的程序员,十分优秀!