Ich verwende eine Drittanbieter-Bibliothek mento.ioGithub für die Erfüllung meiner Anforderungen.AngularJs facebook wie erwähnt: wie zu erwähnen Vorschläge ohne das Trigger-Zeichen, z. '@'
Diese Bibliothek ist gut genug, um Vorschläge nach einem bestimmten Zeichen anzuzeigen, aber meine Anforderung ist, dass der Benutzer Vorschläge erhalten sollte, sobald er wie IntelliSense auf einem Editor zu tippen beginnt.
Problem
Wie den Vorschlag zu starten, wenn ein Benutzer ein beliebiges Zeichen trifft. Gerade jetzt seine einzige Arbeit mit @
Symbol
// Code goes here
var app = angular.module('app', ['mentio']);
app.controller('ctrl', function ($scope) {
$scope.people = [
{ label: 'Joe' },
{ label: 'Mike' },
{ label: 'Diane' }
]
$scope.myval = '';
});
<!DOCTYPE html>
<html>
<head>
\t <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
\t <!-- Latest compiled and minified CSS -->
\t <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
\t \t crossorigin="anonymous">
\t <!-- Optional theme -->
\t <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
\t \t crossorigin="anonymous">
\t <!-- Latest compiled and minified JavaScript -->
\t <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
\t \t crossorigin="anonymous"></script>
\t <!--<link rel="stylesheet" href="style.css" />-->
\t <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
\t <script src="https://jeff-collins.github.io/ment.io/dist/mentio.js"></script>
\t
\t
<script src="script.js"></script>
</head>
<body><div ng-app="app" ng-controller='ctrl'>
\t \t <input type="text" mentio id="test" mentio-id="'test'" mentio-typed-text="typedTerm" mentio-trigger-char="'@'" mentio-items="people"
\t \t \t ng-model="myval" />
\t </div>
</body>
</html>
Verwenden Bootstrap typehead mit angualar –
Ich habe zu diesem git hub-Projekt gegangen, aber das ist meine Anforderungen nicht erfüllt, wie es nur Vorschläge für die gesamte Texteingabe String zeigt, aber ich möchte Vorschlag für jedes Wort wie Intellisence https://github.com/davidkonrad/angular-bootstrap3-typeahead –