       source              = $parse attrs.macAutocompleteSource
       currentAutocomplete = []
 
-      # TODO
-      if attrs.ngModel?
+      # HACK: setTimeout is added to make sure value wont' change afterwards
+      if ctrl?
         $scope.$watch attrs.ngModel, (value) ->
           setTimeout ->
-            element.val value
+            ctrl.$setViewValue value
+            ctrl.$render()
           , 0
 
       #

      # Event to reset autocomplete
      #
      $scope.$on "resetAutocomplete", -> reset()

      reset()
]


          $http(options)
            .success (data, status, headers, config) ->
                fetchedList  = onSuccess?({data, status, headers})
                fetchedList ?= data.data

                resp updateList fetchedList
            .error (data, status, headers, config) ->
              onError? {data, status, headers}
        else
          list = updateList(source($scope) or [])
          resp $filter("filter") list, req.term
