I receive an object that contains a number: time in seconds from midnight.
I want the object to stay in seconds, but display this time in hours format.
A filter can't be used since it is in an input.
The directive is the way to go. I have found questions here, but they all do it the opposite way (changing the object, not the view):
Using angularjs filter in input element
<input type="text" ng-model="time"/>
<script>
angular.module('app')
.controller('AppController', ['$scope', function($scope){
$scope.time = "32400";
}]);
</script>
So, input needs to be : 09:00
$scope.time = 32400.
When changing hours, $scope.time needs to change (in seconds)