[AngularJS] ng-src

2016-11-26 Thread kempiloko
https://jsfiddle.net/es1L24nh/ 

Check fiddle.

The image of the first comment does not load, but the after the first 
comment all the other profile pictures will load successfully. How does 
that comes. In the console log the right path is showing up. 

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] ng-src not update html src after uploading a new image

2015-11-01 Thread Mr. Adam

>
> Even if the 2 divs inside the one controller still not changes ... I used 
> jquery to solve this problem and it's working 
>
 

> $("#UserPhoto").attr("src", data.result.path);
>

but I would like to use angular to do this instead of jquery 

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] ng-src not update html src after uploading a new image

2015-10-31 Thread Mr. Adam
hello every one

I have a profile and I'm showing the user photo on it after loading his 
data from database 
and the binding is working so good

in the same page i upload new image and the variable is changed 
successfully in the script file but the html still the same 

can anyone tells me what happen and why angular not update the photo src 
after updateing 



Personal Information

  


 


  



 
Personal Photo


You can upload a personal photo here. Please use a 
portrait-style photo which is at least 112 pixels wide and 150 pixels high. 
The photo must be a graphic file (JPG, PNG) Max Size is 250KB.






Select file...



Start Upload





MainApp.controller('ProfileController', function ($scope, $http, 
sharedProperties) {
$scope.userProfile = null;
$scope.Photo = null;
GetProfile();

function GetProfile() {
$http({
method: 'Get',
url: 'mypath service'
}).success(function (data, status, headers, config) {
$scope.Photo = data[0].photo;
}).error(function (data, status, headers, config) {
$scope.message = 'Unexpected Error';
});
}

// update photo  and this working so good
$('#fu-my-simple-upload').fileupload({
url: 'service',
dataType: 'json',
add: function (e, data) {
   
},
done: function (event, data) {
// this path is working and I get the new path 
// and it's update the database also but this not update the 
html
$scope.Photo = data.result.path; 
  
},
fail: function (event, data) {
if (data.files[0].error) {
   
}
}
});
});


regards
mohamed adam
   

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] ng-src not update html src after uploading a new image

2015-10-31 Thread fasfsfgs
You are using 2 separate controllers in your page. Although they use the
same constructor, each one is a separate instance.
Can you use just one controller instance (just one ng-controller on your
html)? That should do it for you.

On Sat, Oct 31, 2015 at 11:27 PM, Mr. Adam  wrote:

> hello every one
>
> I have a profile and I'm showing the user photo on it after loading his
> data from database
> and the binding is working so good
>
> in the same page i upload new image and the variable is changed
> successfully in the script file but the html still the same
>
> can anyone tells me what happen and why angular not update the photo src
> after updateing
>
>
>  data-ng-controller="ProfileController" novalidate>
> Personal Information
> 
>   
> 
>  name="Photo"  width="112">
>
> 
> 
>
> 
>
>
>  
> Personal Photo
> 
> 
> You can upload a personal photo here. Please use a
> portrait-style photo which is at least 112 pixels wide and 150 pixels high.
> The photo must be a graphic file (JPG, PNG) Max Size is 250KB.
> 
>
> 
> 
>
> 
> Select file...
>  id="fu-my-simple-upload" />
> 
> 
>  id="hl-start-upload"  >Start Upload
>
> 
>
>
>
> MainApp.controller('ProfileController', function ($scope, $http,
> sharedProperties) {
> $scope.userProfile = null;
> $scope.Photo = null;
> GetProfile();
>
> function GetProfile() {
> $http({
> method: 'Get',
> url: 'mypath service'
> }).success(function (data, status, headers, config) {
> $scope.Photo = data[0].photo;
> }).error(function (data, status, headers, config) {
> $scope.message = 'Unexpected Error';
> });
> }
>
> // update photo  and this working so good
> $('#fu-my-simple-upload').fileupload({
> url: 'service',
> dataType: 'json',
> add: function (e, data) {
>
> },
> done: function (event, data) {
> // this path is working and I get the new path
> // and it's update the database also but this not update the
> html
> $scope.Photo = data.result.path;
>
> },
> fail: function (event, data) {
> if (data.files[0].error) {
>
> }
> }
> });
> });
>
>
> regards
> mohamed adam
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+unsubscr...@googlegroups.com.
> To post to this group, send email to angular@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] ng-src not working in ng-bind-html

2015-04-14 Thread Marco
Hello,

in my controller i'm replacing img urls with urls i get from a database in 
html fragments that i also get from a database

example

div
ptest/p
img src=old/source/image
div



becomes

div
ptest/p
img src=new/source/image
div


the new source for the image url is constructed in the controller and a old 
source is replaced with the new source

this did not work because of the async db operation, therefor i made a 
scope image variable to receive the value of the src and in the html i put 
an ng-src, so angular could bind to it 

div
ptest/p
img ng-src=imagevar
div

in my htm i insert the htm with ng-bind-html (using $sce on the variable)


My problem is that the ng-src=imagevar doesn't get processed, when i look 
at the source in my browser i see img ng-src=imagevar instead of the 
source i need, when i paste the same variable in a

div
{{imagevar}}
/div


it content that needs to get in the src attribute gets displayed ok

where does this go wrong?

thanks

Marco

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] ng-src not working in ng-bind-html

2015-04-14 Thread Caitlin Potter
ng-bind-html does not compile the html template, it just sanitizes and renders 
it. So, directives like ng-src won’t work. You might want to use ngInclude or a 
router for this functionality instead.

 On Apr 14, 2015, at 12:14 PM, Marco marco.sto...@gmail.com wrote:
 
 Hello,
 
 in my controller i'm replacing img urls with urls i get from a database in 
 html fragments that i also get from a database
 
 example
 
 div
 ptest/p
 img src=old/source/image
 div
 
 
 
 becomes
 
 div
 ptest/p
 img src=new/source/image
 div
 
 
 the new source for the image url is constructed in the controller and a old 
 source is replaced with the new source
 
 this did not work because of the async db operation, therefor i made a scope 
 image variable to receive the value of the src and in the html i put an 
 ng-src, so angular could bind to it
 
 div
 ptest/p
 img ng-src=imagevar
 div
 
 in my htm i insert the htm with ng-bind-html (using $sce on the variable)
 
 
 My problem is that the ng-src=imagevar doesn't get processed, when i look 
 at the source in my browser i see img ng-src=imagevar instead of the 
 source i need, when i paste the same variable in a
 
 div
 {{imagevar}}
 /div
 
 
 it content that needs to get in the src attribute gets displayed ok
 
 where does this go wrong?
 
 thanks
 
 Marco
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to angular+unsubscr...@googlegroups.com 
 mailto:angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com 
 mailto:angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular 
 http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] ng-src not working in ng-bind-html

2015-04-14 Thread Luke Kende
Are you trying to replace complete blocks of html? Then yes, use ng-include 
as Caitlin recommends. For ng-src is interpolated not, bound to a 
variable... the proper way to change the source in your case should be:

img ng-src={{imagevar}}

This is advantageous because you can change, parts of the url only, like if 
you know it's always the same file name but the directory changes:

img ng-src={{current_directory}}/image.png



On Tuesday, April 14, 2015 at 2:20:48 PM UTC-6, Marco wrote:

 OK, thanks for the reply, I will check these options

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] ng-src not working in ng-bind-html

2015-04-14 Thread Marco
OK, thanks for the reply, I will check these options

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] ng-src ubuntu firefox

2014-08-19 Thread Adrien Rivard
Hi,

It works for me on unbuntu/firefox31.0, same as chrome.
maybe some sort of corrupted cache ?


On Mon, Aug 18, 2014 at 10:00 PM, Zoltan Szalai defaultd...@gmail.com
wrote:

 Hi,

 Any idea why the image doesn't show up in ubuntu/firefox31.0?
 http://plnkr.co/edit/r6wK2an76dxYft9wSzsd

 It seem to work in chrome, safari and also win7/firefox31.0.

 Thanks,
 Zoltan

 --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




-- 
Adrien Rivard

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] ng-src in ie8: image not loaded and unsafe added to path

2014-02-16 Thread Surreal
Hi,

I just wanted to add an image to my app.
As advised, I used the ng-src directive: 
img ng-src={{app.imgBig}} alt=lorem ipsum height=100 width=200 
title=lorem ipsum /

It works fine on most browsers but it doesn't on ie8.
The image is not loaded as instead of adding the absolute url to the file 
name, it returns the relative and adds unsafe: before it.

Actually, it's trying to load:
unsafe:img/test.jpg
Instead of:
http://mysite.com/img/test.jpg

So you know, it may be related to the fact I had to completely disable SCE 
to support IE7: 
$sceProvider.enabled(false);

A quick fix was to include the base url as a constant and add it at the 
beginning of the image path but it's not the best as the app should be 
dependent from this base path.

Any idea ?

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.


[AngularJS] ng-src directive

2014-02-15 Thread Mark Volkmann
It seems inconsistent that the value of this directive must be surrounded
with {{ }}.
Should it expect an Angular expression the way ng-include does?

-- 
R. Mark Volkmann
Object Computing, Inc.

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.