JSng-tagsInput ne fonctionne pas
var app = angular.module('plunker', ['ngTagsInput']);
//'ngTagsInput'
app.controller('MainCtrl', function($scope, $http) {
$scope.tags = [];
$scope.loadTags = function(query) {
return $http.get('http://localhost/search.php?term='+query);
};
});
HTML:
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mbenford.github.io/ngTagsInput/css/ng-tags-input.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<!--<script src="http://mbenford.github.io/ngTagsInput/js/ng-tags-input.min.js"></script> -->
<script src="ng-tags-input.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<div class="container-fluid">
<div>
<tags-input ng-model="tags" >
<auto-complete source="loadTags($query)"></auto-complete>
</tags-input>
</div>
</div>
<p>Model: {{tags}}</p>
</body>
</html>
Ceci est un exemple de code html qui peut afficher la barre de filtre en fonction de l'étiquette. Mais je veux intégrer avec déjà implémenté une autre application. Cette application a sa propre application, contrôleur défini. Le problème est que je ne peux pas voir les changements, même après avoir fait les changements dans le modèle (L'application principale utilise le modèle de moustache). Ce sont les changements que j'ai faits.
regardant la section JS je viens d'ajouter [ 'ngTagsInput'] à la définition de l'application
var app = angular.module('staticSelect', ['ui.bootstrap','ngTagsInput']);
app.controller('ExampleController', ['$scope', '$http', '$rootScope','$timeout', function($scope, $http, $rootScope, $timeout) {
$scope.tags = [];
MES HTML CHANGEMENTS:
<div class="container-fluid" >
<p>some junk</p>
<tags-input ng-model="tags" >
<!--<auto-complete source="loadTags($query)"></auto-complete> -->
</tags-input>
</div>
de ma compréhension, il doit montrer atleast la boîte d'étiquette, mais il ne montre pas.
MES QUESTIONS:
1. Am i missing something ?
2. What are the things one should check when doing these kinda work (i am a newbie to UX)
Y a-t-il des erreurs dans la console de développement? –
non je ne vois aucune erreur dans la console –
@AbuTahir plese post json vous obtenez de ''http: //localhost/search.php? Term =' + requête' –