我看到它很简单,使用groovy复制文件
new File('c:/temp/dst.zip') << new File('c:/temp/src.zip').bytes
Run Code Online (Sandbox Code Playgroud)
是否有更简单的方法来复制整个目录结构?我试图避免递归迭代和创建整个结构
我正在使用具有原色和强调色的棱角材质主题。我有两个不同的主题,分别定义为橙色和绿色,最终用户可以动态更改。theme.scss如下所示
@import '~@angular/material/theming';
@include mat-core();
@mixin widget-theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
.fa-icon {
color: mat-color($primary);
}
.fa-table-data-row-selected {
background-color: mat-color($accent) !important;
color: #152A23
}
.fa-text-link {
color: #2A5D9F;
}
}
$custom-primary: mat-palette($mat-blue-grey,500);
$custom-accent: mat-palette($mat-light-blue, A200);
$custom-warn: mat-palette($mat-red);
$custom-theme: mat-light-theme($custom-primary, $custom-accent, $custom-warn);
@include angular-material-theme($custom-theme);
@include widget-theme($custom-theme);
//Orange theme
$ora-primary: mat-palette($mat-orange, 800);
$ora-accent: mat-palette($mat-deep-purple, A100);
$ora-theme: mat-light-theme($ora-primary, $ora-accent);
.orange-theme {
@include angular-material-theme($ora-theme);
@include widget-theme($ora-theme);
}
//green theme
$green-primary: mat-palette($mat-green, 800);
$green-accent: mat-palette($mat-lime, A700);
$green-theme: mat-light-theme($green-primary, $green-accent);
.green-theme {
@include …Run Code Online (Sandbox Code Playgroud) 我们正在为我们的移动应用程序使用 firebase 函数和 firebase 实时数据库。当有人下订单时,我们确实会发送电子邮件,该订单是使用如下 Firebase 数据库触发器实现的:
exports.on_order_received = functions.database.ref("/orders/{id}")
.onCreate((change, context) => {
console.log("start of on_order_received")
...
Run Code Online (Sandbox Code Playgroud)
以上触发器对我们来说很好用。现在,我们有一些要求,图片中没有 DB 触发器。这是一个像下面这样的http请求
exports.daily_sales_report = functions.https.onRequest((req, res) => {
//query data from firebase
Run Code Online (Sandbox Code Playgroud)
问题是我们如何在这里访问实时数据库对象?或者换句话说,我如何获得对 /orders 节点的访问权限?我试过如下
exports.daily_sales_report = functions.https.onRequest((req, res) => {
//query data from firebase
var ref = functions.database.ref('orders')
ref.orderByValue().limitToLast(3).on("value", function(snapshot) {
snapshot.forEach(function(data) {
console.log("The " + data.key + " dinosaur's score is " + data.val());
});
})
Run Code Online (Sandbox Code Playgroud)
但这不起作用。我收到错误“orderByValue() 不是函数”
我使用下面的代码从纪元获取 hh:mm
var dt = new Date(t*1000);
var hr = dt.getHours();
var m = "0" + dt.getMinutes();
return hr+ ':' + m.substr(-2)
Run Code Online (Sandbox Code Playgroud)
对于以下值:
1542895249079 prints: 19:37 Expected: 2:00 PM
1542897015049 prints: 6:10 Expected: 2:30 PM
1542902445344 prints: 2:35 Expected: 4:00 PM
Run Code Online (Sandbox Code Playgroud)
我对此有点迷失,因为上面代码的转换值对我来说看起来完全奇怪。
如何将javascript中的默认日期转换为YYYY-MM-DDTHH:MM:SS格式。
new Date()返回2016年8月7日星期日格林尼治标准时间+0000(UTC)
我需要当前日期为上述格式。
我必须从我的REST服务中获取一个值并将其分配给knockout observable
代码看起来像
mydata=$.ajax({ url: 'http://myserver:7101/MUDRESTService/rest/v1/mudstats?onlyData=true',?
type: 'get',
dataType: 'json',
success: function(output) {?
dailyMinRest = JSON.parse(mydata.responseText).items[0].AvgSession;
console.log(dailyMinRest)
sessionCountRest = JSON.parse(mydata.responseText).items[0].Sessions;
}?
});
self.dailyMin = ko.observable(dailyMinRest);
Run Code Online (Sandbox Code Playgroud)
问题出在最后一行.如果我留在这里显然没有保证它在休息后返回响应时执行.但是,如果我将它移到succss方法内部,那么自变量就不会被解析.
我试过简单
select date_created from smc_log_messages where rownum =1
order by date_created desc
Run Code Online (Sandbox Code Playgroud)
它会返回一个日期
15-SEP-16 10.15.49.099000000 PM
Run Code Online (Sandbox Code Playgroud)
但是,当我跑
select date_created from smc_log_messages
order by date_created desc
Run Code Online (Sandbox Code Playgroud)
我看到像这样的数据
30-SEP-16 12.39.00.006000000 AM
30-SEP-16 12.38.59.997000000 AM
Run Code Online (Sandbox Code Playgroud)
所以,基本上添加rownum会影响结果.难道我做错了什么?
我有一个输入文本,在离子页脚内有两个按钮.一个按钮附加到表单提交.但是,如果我点击另一个按钮,它也会触发提交按钮.
代码如下:
<ion-footer padding>
<form [formGroup]="chatForm" (ngSubmit)="sendChatMessage()">
<button ion-button (click)="listenForSpeech()" clear><ion-icon name="microphone" isActive={{microphoneActive}} style="zoom:1.0;"></ion-icon></button>
<ion-input type="text" #sendInput formControlName="messageInput" placeholder="start typing..."></ion-input>
<ion-buttons end>
<button ion-button clear type="submit" [disabled]="chatForm.controls['messageInput'].value === ''"><ion-icon name="ios-send" style="zoom:2.0;"></ion-icon></button>
</ion-buttons>
</form>
</ion-footer>
Run Code Online (Sandbox Code Playgroud)
所以在这种情况下如果我点击麦克风按钮,我也会看到sendChatMessage()被激活.
我有一个离子卡,根据布尔值显示或隐藏的元素很少。
一切正常,但更改非常迅速,因此无法提供出色的用户体验。
离子卡看起来像:
<ion-card>
<img *ngIf="item.showActions == false" class="img-card" src="{{item.imgUrl}}"/>
<ion-card-content>
<ion-card-title>{{item.msg}}</ion-card-title>
</ion-card-content>
<ion-grid *ngIf="item.showActions == true" no-padding style="border-top: 0.5px solid #E7E7E7;border-bottom: 1px solid #E7E7E7">
<ion-row padding><ion-col><p>For this news you can take following actions</p></ion-col></ion-row>
<ion-row text-center>
<ion-col>
<br/>
<button ion-button clear small icon-left (click)="presentPopover($event)">Show
</button>
<h2>Create Task</h2>
<br/>
</ion-col>
</ion-row>
</ion-grid>
<ion-card>
Run Code Online (Sandbox Code Playgroud)
因此item.showActions是一个布尔值,我会根据某些操作进行翻转。我希望这种过渡能够像翻转或淡入淡出一样顺利进行。
在我的用例中,我想显示侧面菜单以及我的离子3角应用程序中的选项卡.用例是:最初显示选项卡,隐藏侧边菜单(设置为启用(false)).第一页显示了一个添加到购物车的按钮,这样做会在标题区域显示购物车,点击购物车会显示登录页面.一旦您登录,订单摘要页面就会出现.此时我想显示侧边菜单.所以ionviwedidload我在设置menu.enable(true).虽然它显示菜单图标但不显示实际菜单.
最小的测试用例是https://www.dropbox.com/s/tq202w3p6yf32fj/tab-menu_app.zip?dl=0
尝试:
1.运行应用程序
2.单击"添加到购物车"按钮
3.单击右侧标题中的购物车
4.这将显示登录页面模型.单击登录按钮
5.摘要页面显示菜单图标.点击它没有任何作用
我正在尝试使 ios 上的段看起来与它们在 android 上的外观相同。参考https://beta.ionicframework.com/docs/api/segment
我尝试使用 css 属性,例如
segment-button-checked {
--background-checked: transparent !important;
--color-checked: white !important;
border-bottom: 1 px solid white
}
ion-segment-button {
--color: #8CA2A5;
--border-color: transparent !important
}
Run Code Online (Sandbox Code Playgroud)
选定的按钮属性不会以这种方式工作。并且整体视觉上看起来不像在 android 上看起来那么好看