Comments (4)
Hi @kacan98 thanks for raising the issue. I will look into this soon but in the meantime, the relevant sections of source code are
app.component.html
...
<h2>Customize icons</h2>
<h6>Following icons sourced from <a href="http://www.onlinewebfonts.com/icon">Icon Fonts</a> and licensed by CC BY 3.0</h6>
<ngx-stars [readonly]="true" [size]="2" [initialStars]="1.5" [customStarIcons]="curvyStarUrls"></ngx-stars>
<ngx-stars [readonly]="true" [size]="2" [initialStars]="2.5" [customStarIcons]="heartUrls"></ngx-stars>
<ngx-stars [readonly]="true" [size]="2" [initialStars]="3.5" [customStarIcons]="circleUrls"></ngx-stars>
...
app.component.ts
export class AppComponent {
...
curvyStarUrls = {
empty: '../assets/curvy-star-empty.svg',
half: '../assets/curvy-star-half.svg',
full: '../assets/curvy-star-full.svg',
};
heartUrls = {
empty: '../assets/heart-empty.svg',
half: '../assets/heart-half.svg',
full: '../assets/heart-full.svg',
};
circleUrls = {
empty: '../assets/circle-empty.svg',
half: '../assets/circle-half.svg',
full: '../assets/circle-full.svg',
};
...
}
The app structure showing the assets folder looks like
from ngx-stars.
All the code you posted looks fine so I don't have an immediate theory as to what the issue is. Is it possible to put up an example of it not working on a branch I could check out or something? I am assuming "src/assets"
is listed under assets
in your angular.json
? Is there anything in the console when they fail to load? And does anything get displayed on the page?
from ngx-stars.
Actually I have just noticed in your example, the names in your ts file (star-outline.svg, star-half.svg and star.svg) do not match the names in your assets folder (icon.svg and icon-outline.svg) - could this be it?
from ngx-stars.
Hi did you ever get this working?
from ngx-stars.
Related Issues (13)
- How I can disable half-star selection ? HOT 2
- It only works with older font-awesome version HOT 10
- Reinitialise issue HOT 5
- Cannot get this to work in IE 11 HOT 7
- Unable to reset in reactive forms. HOT 5
- Update initialStars HOT 3
- Ivy distribution HOT 3
- Size HOT 2
- can't resolve ngx-stars HOT 4
- ngx-stars support for angular 12 HOT 3
- Selecting a half star in RTL mode HOT 4
- I can't update the value of intialStars via data binding, only by clicking. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-stars.