Added support for initializing typeahead inside promises

Added so that the scope watches for changes before initializing. Every time a change is detected, it checks if the dataset has been set, if it has it then it itnitializes the typeahead.