klarsys/angular-material-icons

Just won't animate with the example you have...

Closed this issue · 10 comments

So I did nothing but follow the steps you have here:
https://klarsys.github.io/angular-material-icons/

I've include both libs (cuz i want animation):

    <script src="//cdn.jsdelivr.net/angular-material-icons/0.4.0/angular-material-icons.min.js"></script> 
    <script src="//cdnjs.cloudflare.com/ajax/libs/SVG-Morpheus/0.1.8/svg-morpheus.js"></script> 

I get no load errors at all so for sure both libs are loaded...

then i have your directive WITH the option attr. that should trigger the anination auto-magically :)

I see the icon fine but there is no animation. questions:

  1. why?

  2. are you internally using the code that I see needs to be used when using this animation library natively:
    var myIcons = new SVGMorpheus('#myIconSet');

  3. can you give me some code that works properly or tell me how to better debug why? is the animation just supposed to happen for me? i'm not sure what the triggers are may can you explain how that works?

sorry bout all the queries i just really dig the way this looks :)

  1. Animation (morphing) will trigger when there is a change in icon attribute from your controller and that if the new icon is different from currently displayed.
  2. Yes.
  3. I recommend looking at index.html and demo.js in this repo. That's the code behind live demo.

Ok.. figured there was maybe just some holes in the instructions. I was just going from this doc:
https://klarsys.github.io/angular-material-icons/

and there is no mention on how to make it animate or the mechanics, just says to include morpheus. Maybe just add parenthetically in that doc (..."see the demo for details on how the animation works from one icon to another via your controller") or something like that. Think most developers all they need is a working example and they can figure it out right?

thanks I will give it a go and let you know if i have any luck... sure i can figure it out because i see your stuff animating :)

OK. Updated the document.

@jeffthompson1971 how did you make it to work?
@urmilparikh what changes you have made this to work in the document?

@sajeetharan, you can refer source of demo page (index.html in github).
Basically, when including directive in your html, use something like:
<ng-md-icon icon="{{icon}}"></ng-md-icon>
...and then change $scope.icon in your controller based on timer or some other event.

I Have done that, the demo works fine . when i take a single icon and trying to animate it does not work? can you add a working sample for single icon animation?

Morphing can happen only between two different icons. For animating single icon, consider using css.

Strange issue here, but my icon will not change unless I hover over it (ie, it won't do it automatically). Doesn't seem to be happening on the demo site and I'm not sure why this is happening. Has it happened before?

Can you share a plunker or a codepen showcasing the issue?

Fortunately it looks like it was just me being dumb. I eventually remembered that I was modifying the data outside of angulars digest scope, and hovering over it triggered a digest. All good now. Thanks for the library!