riteshgandhi / ng-star-rating

Highly Customizable and Responsive Star Rating library built using Angular
MIT License
38 stars 10 forks source link

Angular universal issue #28

Open ihor-zinchenko opened 4 years ago

ihor-zinchenko commented 4 years ago

Hi! I'm using angular universal and I've got next error ERROR TypeError: Cannot Cannot set property 'index' of undefined

Compiled code is

maxStars.forEach(starNumber => {
  let starElement = document.createElement("span");
  starElement.dataset.index = (starNumber + 1).toString(); // error
  starElement.title = starElement.dataset.index;
  starContainer.appendChild(starElement);
  this.stars.push(starElement);
});

http://joxi.ru/Q2K5BWluLQynlr http://joxi.ru/8239KN6F9Yaovr

JussV commented 4 years ago

I am having the same problem when using SSR with angular universal. However, the error is not reproducible in CSR mode.

Screen Shot 2020-08-11 at 15 22 30

have used: "ng-starrating": "1.0.20", angular 9