How to add svg custom icon ionic 2

How to add custom ionic 2 icon, I have svg file, I need to add icon in menu

this.pages = [ {icon: 'Test', title: 'Logout', component: LoginPage } ]; <ion-list> <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)"> <ion-icon name="{{p.icon}}" svgversion item-left></ion-icon> {{p.title}} </button> </ion-list> 

layout.scss

 ion-ion[name="test"][svgversion] { content: url("../../img/accountsDeposits.svg"); } 
+6
source share
2 answers

You can use fontastic to create svg icon fonts from your svg icons, you can use it online or export to your own svg fontface, it gives you instructions on how to use it, it is FREE

Follow the link

0
source

You just add /src/theme/global.scss or /page/your-page/your-page.scss :

 .logo { background: url(../assets/images/logo-vc.svg) no-repeat top left; background-size: contain; width: 80px; height: 35px; margin: 20px auto 0 auto; } 
+1
source

All Articles