zyra/ionic-material-icons

Can't see icons - showing text instead (lazy loading)

pliablepixels opened this issue · 7 comments

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:
screen shot 2017-07-09 at 10 03 14 am

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

Thanks for reporting this. I'll take a look soon.

Thanks! If it helps, my repo is open source and is here. If you run it, go past the intro screen, tap on any category in the category screen, you will see a screen where I try and display both a font-awesome icon (which works) and a material icon using your lib, which currently does not.

quick update - the icon does show up on the device (iOS), just not on the desktop browsers (tried both Chrome and Safari)

img_1248

it maybe due to the new @ionic/app-scripts 2.0.0

If this issue was introduced by @ionic/app-scripts@2.0.0, please update to 2.0.1 and let me know if you're still experiencing any issues.

@ihadeed works now, thx

not working with "@ionic/app-scripts": "3.1.9". Any support?