我需要在表单中添加日历.我想安装这个项目:https: //github.com/vitalets/bootstrap-datepicker
但据说:对于某些样式需要bootstrap的下拉组件(dropdowns.less),对于箭头需要bootstrap的sprite(sprites.less和相关图像).
如何将该文件添加到我的应用程序?
非常感谢你!
我正在建立一个带有bootstrap 3的站点,其想法是在左侧保留一列用于导航,在右侧保留站点内容:
导航的位置应固定,左侧和顶部没有边距.我已尝试使用position:fixed和position:absolute但问题是网站的内容会覆盖导航栏.
如何在左侧正确固定导航栏?我怎样才能避免网站内容覆盖导航栏?
非常感谢你!
css css-position navbar twitter-bootstrap twitter-bootstrap-3
情况:
我有一个发送电子邮件的角度应用程序.有三个字段:地址 - 主题 - 文本.地址字段使用角度ui-select构建
电子邮件地址可以从列表中选择或重新输入.问题是输入新的电子邮件地址.
我试图使用标记属性来获取它.但据我所知,只有当ui-select由一组简单字符串组成而不是由一个对象数组组成时才能工作
码:
<h3>Array of objects</h3>
<ui-select multiple tagging tagging-label="new tag" ng-model="multipleDemo.selectedPeople" theme="select2" ng-disabled="disabled" style="width: 800px;">
<ui-select-match placeholder="Select person...">{{$item.name}} <{{$item.email}}></ui-select-match>
<ui-select-choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
<div ng-bind-html="person.name | highlight: $select.search"></div>
<small>
email: {{person.email}}
age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
</small>
</ui-select-choices>
</ui-select>
<p>Selected: {{multipleDemo.selectedPeople}}</p>
Run Code Online (Sandbox Code Playgroud)
PLUNKER:
http://plnkr.co/edit/nngkvjiQmI44smcNGRGm?p=preview
正如您所看到的,它对于简单的字符串数组而不是对象数组是正常的
题:
如何在ui-select中使用带有对象数组的标记?
情况:
我有一个使用角度拖放的应用程序.
除了一件事,一切都很好.我需要在onStart回调函数中传递一个参数,但我不知道如何.我四处搜寻并尝试了几种可能性但没有成功.函数本身正在工作,已被调用并正确执行,我唯一的问题是将参数传递给它.
代码:
在这个例子中,我做了一个尝试.
<div class="col-sm-4">
<div class="thumbnail" data-drop="true" ng-model='todo_list' jqyoui-droppable="{multiple:true, onDrop:'update_item()'}">
<div class="caption">
<div class="btn btn-info btn-draggable" ng-repeat="item in todo_list track by $index" ng-show="item.title" data-drag="true" data-jqyoui-options="{revert: 'invalid'}" ng-model="todo_list" jqyoui-draggable="{index: {{$index}}, onStart:'set_board_item_id_panel(event, ui, {board_item_id: item.board_item_id})'}">{{item.title}}</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
问题:
如何在角度拖放的回调函数中传递参数?
非常感谢你!
javascript jquery drag-and-drop jquery-ui-draggable angularjs
情况:
我用我的幻灯片Slider Revolution插件.
我需要为显示的图像设置不同的时间(持续时间).例如,我需要显示第一个图像仅2秒,而第二个图像需要显示7秒.
问题:
如何设置上一个项目的时间?可能吗?
代码:
在初始化插件的js函数中,有以下设置: delay:9000,并且更改它,可以设置持续时间,但会考虑所有项目.
这是js函数:
initRevolutionSlider: function () {
var tpj=jQuery;
tpj(document).ready(function() {
if (tpj.fn.cssOriginal!=undefined)
tpj.fn.css = tpj.fn.cssOriginal;
var api = tpj('.fullwidthbanner').revolution(
{
delay:9000,
startwidth:960,
startheight:250,
onHoverStop:"off", // Stop Banner Timet at Hover on Slide on/off
thumbWidth:100, // Thumb With and Height and Amount (only if navigation Tyope set to thumb !)
thumbHeight:50,
thumbAmount:3,
hideThumbs:1,
navigationType:"bullet", // bullet, thumb, none
navigationArrows:"solo", // nexttobullets, solo (old name verticalcentered), none
navigationStyle:"round-old", // round,square,navbar,round-old,square-old,navbar-old, or any from …Run Code Online (Sandbox Code Playgroud) 情况:
我有一个发送电子邮件的角度应用程序.有一个包含三个字段的表单:地址 - 主题 - 文本.
对于地址字段,我使用角度ui-select.
一切都运行正常,除了地址字段上的验证(主题和文本验证工作正常).
编辑:
从版本0.16.1修复此错误.正如@yishaiz所指出的那样.
因此,这个问题及其相关解决方案将ui-select版本视为<0.16.1.
代码:
HTML:
<form name="emailForm" ng-submit="submitForm(emailForm.$valid)">
<div class="row form-group">
<label class="col-sm-2 control-label">To: </label>
<div class="col-sm-10">
<ui-select multiple ng-model="database_people.selectedPeople" theme="select2" ng-disabled="disabled" style="width:100%">
<ui-select-match placeholder="Select person...">{{$item.name}} < {{$item.value}} ></ui-select-match>
<ui-select-choices repeat="person2 in list_people | filter: {name: $select.search.name, value: $select.search.value, db_data_type_id: 5}">
<div ng-bind-html="person2.name | highlight: $select.search"></div>
<small>
email: <span ng-bind-html="''+person2.value | highlight: $select.search"></span>
</small>
</ui-select-choices>
</ui-select>
</div>
</div>
<div class="col-sm-8">
<button type="submit" class="btn btn-primary">Send</button>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
ANGULARJS:
$scope.submitForm = function(isValid) …Run Code Online (Sandbox Code Playgroud) 找不到这两者之间的区别.
将这些内容中的任何一个引导到我的角度应用程序是否有意义?
angular.bootstrap(document,['myApp']);
Run Code Online (Sandbox Code Playgroud)
要么
angularAMD.bootstrap(app);
Run Code Online (Sandbox Code Playgroud) 情况:
我需要在我的Ionic应用程序中加入Google地图.
设置地图:
为了测试它,我已经完成了以下步骤:
将脚本添加到index.html:
<script src="http://maps.google.com/maps/api/js?key=MY_API_KEY&sensor=true"></script>
Run Code Online (Sandbox Code Playgroud)创建一个map div和相关的css:
<div id="map" data-tap-disabled="true"></div>
#map {
width: 100%;
height: 100%;
}
Run Code Online (Sandbox Code Playgroud)制作一个以用户地理位置为中心的基本地图:
.controller('MapCtrl', function($scope, $state, $cordovaGeolocation) {
var options = {timeout: 10000, enableHighAccuracy: true};
$cordovaGeolocation.getCurrentPosition(options).then(function(position){
var latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
var mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
$scope.map = new google.maps.Map(document.getElementById("map"), mapOptions);
}, function(error){
console.log("Could not get location");
});
});
Run Code Online (Sandbox Code Playgroud)问题:
它工作正常,但这是在浏览器中用于测试目的.当我在应用程序或模拟器(Genymotion)中测试它时,地图甚至没有打开.当然它可能很简单:因为我有一个浏览器密钥.
但我已经尝试过其他按键并且无论如何都没有打开.
由于代码是正确的,问题是:
Google Maps …
情况:
在我的app.component中有登录功能.它工作正常,我从API获取用户数据.
我需要将这些数据存储为全局变量,以便能够在整个应用程序中访问它.
我认为共享服务是实现这一目标的方式,但不幸的是,我没有按照我的想法工作.
代码:
服务:
import { Injectable } from '@angular/core';
@Injectable()
export class LoginService {
public accountInfo;
setUserData(value)
{
this.accountInfo = value;
}
getUserData() {
return this.accountInfo;
}
}
Run Code Online (Sandbox Code Playgroud)
app.component:
loginSubmit()
{
// Function reduced to what is essential to the question
this.userService.submitLogin(email, password)
.subscribe((response) => {
if(response.result == 1)
{
this.loginService.setUserData(response.account_info);
var justTesting = this.loginService.getUserData();
// Getting the proper result back
console.log(justTesting);
}
}, (error) => {
console.log(error);
});
}
Run Code Online (Sandbox Code Playgroud)
尝试从另一个组件访问用户数据:
this.accountInfo = this.loginService.getUserData();
console.log(this.accountInfo);
Run Code Online (Sandbox Code Playgroud)
结果是 …
情况
我正在为我的应用设置Gmail API.
我需要导入所有标有特定标签的电子邮件,例如TRASH,SPAM,SENT,UNREAD,STARRED等.
我可以获取收件箱电子邮件列表和单个邮件信息.我可以获得标签列表以及单个标签信息.但我没有找到如何将它们结合起来.
显然,在给定labelId的情况下,没有特定的请求来检索消息列表,并且在电子邮件列表中没有labelId的痕迹.
要求输出:
获取消息列表:
array(3) { [0]=> array(5) { ["messageId"]=> string(16) "14ddc24465a9b72e" ["messageSnippet"]=> string(14) "sample message" ["messageSubject"]=> string(4) "Test" ["messageDate"]=> string(22) "Jun 10th 2015 08:24 AM" ["messageSender"]=> string(44) "SENDER_NAME" } [1]=> array(5) { ["messageId"]=> string(16) "14dd8391372f3035" ["messageSnippet"]=> string(91) "buonasera Date: Tue, 9 Jun 2015 08:08:48 -0400 Message-Id: <CAGL50m_2vPv-Bkzbd+m5iFkx-u-" ["messageSubject"]=> string(4) "Test" ["messageDate"]=> string(22) "Jun 10th 2015 08:24 AM" ["messageSender"]=> string(44) "SENDER_NAME" } [2]=> array(5) { ["messageId"]=> string(16) "14dd7f4f126103c9" ["messageSnippet"]=> string(99) "Ciao meetinghand Suggerimenti per …Run Code Online (Sandbox Code Playgroud)