Kikz Kikz - 1 year ago
491 0

I am having a problem here.
When I'm passing the value of {{}} on my controller.
Instead of transferring the real value. its gives the value as " {{}}"

So when the console.log(country);
The result is {{}}

It should be name of the value


How to pass expression value on ng-init?

<ul ng-controller="mycontroller4">
<div ng-repeat="post in posts">

   <div ng-controller="mycontroller5" ng-init='init("{{}}")'>


myapp.controller( 'mycontroller5', ['$scope', '$http', function( $scope, $http ) {
	$scope.init = function(country) {
		$ country;
		// Load posts from the WordPress API
			method: 'POST',
			url: "/wp-admin/admin-ajax.php",
			params: {
				action: "FUNCTION",
				country: $,
			headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
		success( function( data, status, headers, config ) {
			$scope.posts = data;
		error(function(data, status, headers, config) {	
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download