zyra / ionic-material-icons Goto Github PK
View Code? Open in Web Editor NEWOver 900 Material lcons for Ionic 2+ Apps
License: MIT License
Over 900 Material lcons for Ionic 2+ Apps
License: MIT License
Hi, i can use this with a fixed value like <ion-icon md-name="settings"></ion-icon>
, but it won't work with interpolated/bind values like <ion-icon [md-name]="variable"></ion-icon>
or <ion-icon md-name="{{variable}}"></ion-icon>
.
How to use the ionic2-material-icons in the ion-tab ?
I am not seeing material icons. The CSS properties of ion-icon were still showing from ionic. I inspect element and changed font-family to "material icons", it worked.
ion-icon {
display: inline-block;
font-family: "Ionicons";
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-style: normal;
font-variant: normal;
font-weight: normal;
line-height: 1;
text-rendering: auto;
text-transform: none;
speak: none;
}
HTML code
Hi, thanks for your work! I can't seem to see any icons (testing on a desktop). I am using lazy loading. Here is what I have so far:
package.json
"config": {
"ionic_copy": "./copy.config.js"
},
cat copy.config.js
module.exports = {
copyMaterialIcons: {
src: ['{{ROOT}}/node_modules/ionic2-material-icons/fonts/**/*'],
dest: '{{WWW}}/assets/fonts'
}
ls www/assets/fonts/
MaterialIcons-Regular.eot ionicons.ttf noto-sans.scss roboto-medium.ttf
MaterialIcons-Regular.ttf ionicons.woff roboto-bold.ttf roboto-medium.woff
MaterialIcons-Regular.woff ionicons.woff2 roboto-bold.woff roboto-medium.woff2
MaterialIcons-Regular.woff2 noto-sans-bold.ttf roboto-bold.woff2 roboto-regular.ttf
ionicons.eot noto-sans-bold.woff roboto-light.ttf roboto-regular.woff
ionicons.scss noto-sans-regular.ttf roboto-light.woff roboto-regular.woff2
ionicons.svg noto-sans-regular.woff roboto-light.woff2 roboto.scss
So looks like the config is ok.
app.module.ts
import { MaterialIconsModule } from 'ionic2-material-icons';
also added MaterialIconsModule
to imports
of app.module.ts
Now in foo.module.ts
(where I need to use the ion)
I added
import { MaterialIconsModule } from 'ionic2-material-icons';
also added MaterialIconsModule
to imports
of foo.module.ts
Finally, foo.html
<ion-icon md-name="settings"></ion-icon> Hello
Here is what I see (the name settings, not the icon:
ionic-info:
ionic info
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 2.0.0
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.4.2
System:
Node : v8.1.2
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.0
ios-sim : 5.0.2
npm : 5.0.3
Thanks
I'm unable to load icons that has an underscore, for example card_travel, I follow the steps of the repository but it's not working.
<ion-icon md-name="card_travel"></ion-icon>
Thanks for your help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.