i have a page with a dynamic content 
witch changed by ajax.load() <https://api.jquery.com/load/>;

html sample code 
----------
<html ng-app="">
<body  ng-controller='LocalResourceCtrl' data-ng-init="init()">
<table  >
<tr style="background-color:#f5f5f5">
<td >
                    <h2>
                       {{GetLocalResource('ApplicationName')}}
                    </h2>
 </td>
</tr>
<tr>
 <td >
<div id="PageContent" style="position:relative;" ></div>
</td>
</tr> 
</table> 
</body></html>
----------
js that is use to update content 

---------
function loadContent(pagename, PageParam) {
var newURL = "View/something.php";
        $("#PageContent").load(encodeURI(newURL),'',function(){
            mainScope.$apply();
        });
}

---------

something.php content 
--------
  {{GetLocalResource('key')}}
-------
finally the controller 
--------
var mainScope;
var loadend = false;
function LocalResourceCtrl($scope) {
mainScope = $scope;
    $scope.AllLocalResources = Array();
    $scope.init = function() {
        $.ajax({
            type: "GET",
            url: "view/webmethodes/User.php",
            data: {FNNAME: "GetAllResources"}
        }).success(function(data) {
            $scope.AllLocalResources = JSON.parse(data);
            $scope.$apply();
        });
    };
    $scope.GetLocalResource = function(key) {
        var name = '';
        $.each($scope.AllLocalResources, function(index, resource) {
            if (resource.Resource_Key == key) {
                name = resource.Resource_ar;
                return;
            }
        });
        if (key != '') {
            return name;
        } else {
            return key;
        }
    }
} 
------- 
                       {{GetLocalResource('ApplicationName')}} is binded 
successfully 
but after the ajax load the new content 
  {{GetLocalResource('key')}} add as string in the page 

how to fix this??

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to