This is my first project on angular. I have created a directive. I am not able to insert the value which I am fetching from an object served by a RESTful API. The object as shown in the console is like this,

Below are the necessary files,
knob.js(directive)
angular.module('knob', [])
.directive('knob', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.knob({
fgColor: attrs.fgColor
});
}
}
})
dashboard.js(controller)
myApp.controller('DashController', function($scope, $http, $cookies, $cookieStore) {
$http({
url: site + '/company/dashboard',
method: "GET",
transformRequest: encodeurl,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).success(function(data) {
console.log(data); //data has the object that i want to use
$scope.dash = data.count;
}).error(function(res) {
console.log(res);
});
});
dahboard.html(view)
<li>
<div class="knob_contain">
<h4 class="knobs_title">Deals Left This Month</h4>
<input type="text" value="{{dash.profile}}" knob class="dial dialIndex">
</div>
</li>
I want the count.profile value to be bound to input type where I am using my knob. I will give you more files if you need.
<input type="text" ng-model="dash.profile" knob class="dial dialIndex">$scope.dash...stuff from my code to do something else. Thank you for your answer. Works. Can you make it an answer so that I may except it? I would also love to give a property ofdata-readonly= "true". I would appreciate if you can add that in your answer as well. Upvoted.