问题描述
限时送ChatGPT账号..我正在尝试在我现有的 AngularJS 应用中使用 anuglar-slider.
我在此处关注了作者的评论>
我从作者的 github 下载了以下文件(在 Head 标签中)并添加到我的 index.html
HTML 代码:
<link rel="stylesheet" href="css/angular-slider.css"><script src="js/vendor/angular-slider.js"></script>头部><身体><slider floor="10"天花板="60" ng-model-low="lowValue" ng-model-high="highValue"></slider>
App.js(Angular 代码).我按照作者的指示添加了第二行,我怀疑我在那里做错了
var app = angular.module('myApp', [])angular.module('uiSlider', []);app.constant('配置',{baseURL : "http://blah",http超时:36000});app.config(function($logProvider) {$logProvider.debugEnabled(true);});//和其他一些特定于应用程序的代码如下
我在浏览器中没有看到任何滑块呈现.但是,应用中较旧的 Angular 特定功能仍然有效,并且浏览器的控制台中没有错误.
如果您在上面找不到问题,请随时提出在 AngularJS 应用程序中实现范围滑块的任何其他方法.
我对 AngularJS 还很陌生
如果您喜欢我也在这里发布作者的库文件代码,请告诉我.
解决方案好的,我在准备这个的时候发现了一些问题,但现在可以了:
发现的问题:
需要 angularjs 版本1.1.4 或更高
你需要有 slider-template.html
文件和@Pascal 说的一样,你需要包含 uiSlider
:
var app = angular.module('myApp', ['uiSlider'])
我在下面为您准备了一个工作演示.希望能帮到你
演示
I am trying to use anuglar-slider in my existing AngularJS app.
I followed the author's comments here
I downloaded below files (in Head tag) from author's github and added in my index.html
HTML code:
<head>
<link rel="stylesheet" href="css/angular-slider.css">
<script src="js/vendor/angular-slider.js"></script>
</head>
<body>
<slider floor="10" ceiling="60" ng-model-low="lowValue" ng-model-high="highValue"></slider>
</body>
App.js (Angular code) . I added second line as per Author's instructions, I suspect I did do something wrong there
var app = angular.module('myApp', [])
angular.module('uiSlider', []);
app.constant('Config',
{
baseURL : "http://blah",
httpTimeout : 36000
});
app.config(function($logProvider) {
$logProvider.debugEnabled(true);
});
//and some other app specific code follows
I don't see any slider rendering in browser. However, the older Angular specific functionality in the app still works and there is no error in browser's console.
If you cannot find problem above, feel free to suggest any other way to implement range slider in AngularJS app.
I am fairly new to AngularJS
Let me know if you like me to post Author's library file code here as well.
解决方案Ok I found some troubles when preparing this but now it's working:
Founded troubles:
it's required angularjs version1.1.4 or higher
you need have slider-template.html
file
and like @Pascal said you need to include uiSlider
:
var app = angular.module('myApp', ['uiSlider'])
I prepared for you a working demo below. I hope it will help you
DEMO
这篇关于如何在 AngularJS 中实现 jQuery 范围滑块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论