Closed quocnguyen closed 8 years ago
@quocnguyen could you please put you issue related sample code in codepen which will help to understand the issue.. thanks.
Here is the code pen : http://codepen.io/andre-morassut/pen/QyqNdj
The first avatar is with a harcoded data attribute such as "U", the second one has its data attribute declared as Angular expression (eg. {{expression}}).
Two issues here :
@andre-morassut Thanks for the codepen i will look into that issue.
@andre-morassut after analyzing the codepen its looks like angularjs 1.1.5 version isolation scope issue with directive, after changing the version from 1.1.5 to 1.1.6 its working fine without any changes updated forked codepen http://codepen.io/anon/pen/obGdaw.
looks like no need to change the directive code if con't upgrade the angularjs version i will give patch ngletteravatar.js as fix.
@uttesh Thanks for your quick reply :) Indeed, now the avatar is displayed on the first page load. But it seems that your fork still suffers from the main issue raised by @quocnguyen : when I type in the input field, the avatar won't change. Tested on Chrome 47, IE11, FF43. Do you reproduce this issue?
@andre-morassut could you please provide me the codepen if you have any that will help me to analyze the issue. thanks.
The issue can be reproduced with your updated forked codepen : http://codepen.io/anon/pen/obGdaw. If you type in the input field, the avatar won't change.
@andre-morassut If you're in a hurry here's a hack that makes it work: http://codepen.io/anon/pen/WrJKoP
Thank you @uttesh for the plugin, it's fantastic!
Thanks @motasay :)
@motasay thanks for the hack fix. i will fix the issue once i'm done with my other library implementation.
@andre-morassut next release i will address this issue.
@uttesh OK, great!
My PR fixes this issue with very few lines of code. A codepen demo is here or just check out the code changes they should be easy to read.
Thanks guys for the hacks and support, made the changes in the library and added fix for this issue i.e. added 'dynamic
' attribute if that is set to true then data scope will be watched for the updates and on scope apply event trigger watch() will create the updated letter avatar.
ex: ng-letter-avatar(data="{{vm.selected.username}}")
when vm.selected changed, avatar still show the old one.