2

这是我从控制台得到的错误。我在这个网站上使用了 angular.js,但我希望我可以只使用masonry.js没有angular-masonry.

Bad masonry element: null
q()masonry....min.js (line 9)
a = null
c = Object { columnWidth=200, itemSelector=".item"}
d()masonry....min.js (line 9)
ui.js()

JavaScript:

var container = document.querySelector('#container');
var msnry = new Masonry( container, {
  // options
  columnWidth: 200,
  itemSelector: '.item'
});

var msnry = new Masonry( '#container', {
  // options
});

HTML:

<div class="content">
   <div id="container" class="list-container tiles-column-wrapper">
      <div class="tiles-column item ng-scope" ng-class="{active: $routeSegment.$routeParams.artifactId === artifact.artifactId}" ng-repeat="artifact in artifacts | orderBy:'-postedTimestamp'">
      <div class="tiles-column item ng-scope" ng-class="{active: $routeSegment.$routeParams.artifactId === artifact.artifactId}" ng-repeat="artifact in artifacts | orderBy:'-postedTimestamp'">
      <div class="tiles-column item ng-scope" ng-class="{active: $routeSegment.$routeParams.artifactId === artifact.artifactId}" ng-repeat="artifact in artifacts | orderBy:'-postedTimestamp'">
    </div>
</div>
4

0 回答 0