मेरे पास रेल परियोजना पर मेरी रूबी में एक कोणीय-एप चल रहा है और अब मैं angular.js का उपयोग करके कुछ टाइपहेड खोज को कार्यान्वित करना चाहता हूं और नहीं ढूंढ सकता समाधान typeahead directive running
कैसे बनाना है।टेम्पलेट लोड करने में विफल: रेल ऐप पर रूबी में टेम्पलेट/टाइपहेड/typeahead.html
प्रश्न: मेरे प्रोजेक्ट में कोणीय टाइपहेड निर्देश कैसे स्थापित करें?
वर्तमान समाधान वर्णित bellow मैं इस सांत्वना मिल रहा है के साथ:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/template/typeahead/typeahead.html
- एनजी-ऐप काम कर रहा है और संबंधित js और सीएसएस फ़ाइलों के रूप में अच्छी तरह से html में जुड़े। इस स्रोत
मैं अनुसरण कर रहा हूं: bootstrap-ui-angularjs
क्या मैं पहले से ही किया था:
-
public\assets\javascripts
निर्देशिका प्रकट संपत्ति पाइप लाइन के रूप में आम तौर पर में
angular-ui-bootstrap.js
डाउनलोड किया गया:// = jquery // = की आवश्यकता है jquery_ujs // = jquery.tokeninput // = की आवश्यकता है बूटस्ट्रैप // = कोणीय // = कोणीय-UI-बूटस्ट्रैप // = requ_tree की आवश्यकता है।
3.checked अगर js
पृष्ठ पर कर रहे हैं: (सिर्फ सवाल में स्क्रिप्ट)
<link href="/assets/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/bootstrap.js?body=1" type="text/javascript"></script>
<script src="/assets/angular.js?body=1" type="text/javascript"></script>
<script src="/assets/angular-ui-bootstrap.js?body=1" type="text/javascript"></script>
my ng-app:
<div ng-app='plunker'>
<div class='container-fluid' ng-controller="TypeaheadCtrl">
<pre>Model: {{result | json}}</pre>
<input type="text" ng-model="result" typeahead="suggestion for suggestion in cities($viewValue)">
</div>
</div>
<script>
angular.module('plunker', ['ui.bootstrap']);
function TypeaheadCtrl($scope, $http, limitToFilter) {
//http://www.geobytes.com/free-ajax-cities-jsonp-api.htm
$scope.cities = function(cityName) {
return $http.jsonp("http://gd.geobytes.com/AutoCompleteCity?callback=JSON_CALLBACK &filter=US&q="+cityName).then(function(response){
return limitToFilter(response.data, 15);
});
};
}
</script>
वहाँ कुछ है कि मैं क्या संबंध में याद आ रही है मौजूदा कोणीय निर्देशों को स्थापित करने के लिए है ? जैसे this link
आपको फ़ाइल को मैन्युअल रूप से डाउनलोड और जोड़ने की आवश्यकता नहीं है: https://github.com/angular-ui/bootstrap-bower/issues/9 – tatsuhirosatou