Currently, I am working with AngularJS and have created a controller along with a directive.
directive = ->
scope:
items: "=mkTagsInput"
link: (scope, element, attributes, controller) ->
$(element[0]).tagsinput()
$(element[0]).tagsinput('input').typeahead
name: "list"
local: scope.items
This is my CoffeeScript directive implementation so far.
<input type="text" data-role="tagsinput" mk-tags-input="labels" />
I'm facing an issue where I initialize the 'labels' array with [], and although I make an Ajax request to populate the data, the directive seems to be loaded too early. As a result, the value in scope.items always remains as [].
Does anyone have any ideas on how I can resolve this?