Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

angular-ui/ui-mention

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ui-mention

Facebook-like @mentions for text inputs built around composability

Contribute

  1. npm install
  2. npm install -g gulp bower
  3. bower install
  4. gulp [watch]
  5. Compiling the example code: gulp example [watch]

Amazing Features!

Find things!:

mention.findChoices = function(match) {
  // Matches items from search query
  return [/* choices */].filter( choice => ~this.label(choice).indexOf(match[1]) );
}

Type too damn fast? Throttle that bitch:

mention.findChoices = _.throttle(function(match) {
  return [/* choices */];
}, 300);

Hate redundancy? De-dupe that shiz:

mention.findChoices = function(match, mentions) {
  return [ /* choices */ ].filter( choice => !mentions.some( mention => mention.id === choice.id ) )
};

Use the awesome power of the internet:

mention.findChoices = function(match) {
  return $http.get('/users', { params: { q: match[1] } })
    .then( response => response.data );
}

Your servers are slow? Bitch please.

mention.findChoices = function(match) {
  mention.loading = true;
  return $http.get(...)
    .then( response => {
      mention.loading = false;
      return response.data;
    });
}

Dropdown that list like it's hot:

<ul ng-if="$mention.choices.length" class="dropdown">
  <li ng-repeat="choice in choice" ng-click="$mention.select(choice)">
    {{::choice.name}}
  </li>
</ul>

SPINNIES!

<ul ng-if="$mention.choices.length" class="dropdown">
  <li ng-show="$mention.loading">Hacking the gibson...</li>
  <li ng-repeat=...>...</li>
</ul>

About

Facebook-like @mentions for text inputs built around composability

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 12