brazorf
brazorf

Reputation: 1961

Simple angular ment.io menu not working

Markup

<input type="text" 
   mentio
   mentio-id="'test'"
   mentio-typed-text="typedTerm"
   ng-model="myval"/>

<mentio-menu
    mentio-for="'test'"
    mentio-trigger-char="'@'"
    mentio-items="mentioPeople"
    ></mentio-menu>

Inside controller:

module.controller($scope) {
    $scope.mentioPeople = [{label: "Test"}];
}

The above code is not working (nothing happens when i do enter the '@' character).

If i embed the very same options as attribute directives in the input element, it works - see the following:

<input type="text" mentio
   mentio-id="'test'"
   mentio-typed-text="typedTerm"
   mentio-trigger-char="'@'"
   mentio-items="mentioPeople"
   ng-model="myval"/>

Why? What am i doing wrong in the first example?

Upvotes: 2

Views: 2072

Answers (1)

brazorf
brazorf

Reputation: 1961

It turns out that the mentio-search option is mandatory. The following

<mentio-menu
    mentio-for="'test'"
    mentio-trigger-char="'@'"
    mentio-items="mentioPeople"
    mentio-search="search()"
        ></mentio-menu>

will work.

Credits to ronaldheft here

Upvotes: 2

Related Questions