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.