मैं यहाँ से शैली में से एक का इस्तेमाल किया है उपयोग करने के लिए: http://tympanus.net/Development/TextInputEffects/index.htmlकोणीय चल इनपुट लेबल Typeahead
एक इनपुट निर्देश बनाने के लिए कृपया plunker देखें: https://plnkr.co/edit/wELJGgUUoiykcp402u1G?p=preview
यह मानक इनपुट फ़ील्ड के लिए महान काम कर रहे, हालांकि, मैं विर्थ ट्विटर टाइपहेड काम करने के लिए संघर्ष कर रहा हूं: https://github.com/twitter/typeahead.js/
प्रश्न - मैं अपने फ़्लोटिंग इनपुट लेबल को टाइपहेड के साथ कैसे उपयोग कर सकता हूं?
app.directive('floatInput', function($compile) {
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
elemTitle: '=elemTitle',
elemtId: '=elemeId'
},
templateUrl: 'input-template.html',
link: function(scope, elem, attrs) {
var ngModelName = elem.attr('input-model');
var inputElem = angular.element(elem[0].querySelector('input'));
inputElem.attr('ng-model', ngModelName);
$compile(inputElem)(scope);
$compile(inputElem)(scope.$parent);
var inputLabel = angular.element(elem[0].querySelector('label span'));
inputLabel.attr('ng-class', '{\'annimate-input\' : '+ngModelName+'.length > 0}');
$compile(inputLabel)(scope);
},
controller: function($scope) {
$scope.title = $scope.elemTitle;
$scope.inputId = $scope.elemId
}
}
})
HTML:
<div>
<span class="input input--juro">
<input class="input__field input__field--juro" type="text" id="{{inputId}}" ng-model="tmp" />
<label class="input__label input__label--juro" for="{{inputId}}">
<span class="input__label-content input__label-content--juro">{{title}}</span>
</label>
</span>
</div>
जहाँ आप अपने कोड में 'typeahead' संदर्भित किया है? –
@ जोसेफफारश - मुझे लगता है, मुझे नहीं पता कि कहां से शुरू करना है। –
कृपया आपके पास क्या प्रश्न है इसके बारे में अधिक स्पष्ट रहें। आपने क्या प्रयास किया है क्या आपको कोई त्रुटि दिखाई देती है? –