我正在尝试将 S3 对象从一个存储桶复制到另一个存储桶,响应如下所示 -
`object(stdClass)#24 (3) {
["error"]=> array(2) {
["code"]=> string(9)
"NoSuchKey" ["message"]=> string(33)
"The specified key does not exist."
}
["code"]=> int(404) ["headers"]=> array(1) {
["type"]=> string(15) "application/xml"
}
}
Run Code Online (Sandbox Code Playgroud)
`
这是代码的外观 -
var_dump($this->s3->copyObject('bucket_1','bucket_1/'. images/1.jpg, 'bucket_2', 'bucket_2/images')).die();
Run Code Online (Sandbox Code Playgroud)
根据copyObject 的方法签名,我需要提供Source object URI和Destination object URI。
任何人都请帮助我知道这里出了什么问题?
谢谢。
我在我的Angular 2项目中使用角度材料,同时添加<md-input-container></md-input-container>我收到此错误:
md-input-container必须包含mdInput指令.您是否忘记将mdInput添加到本机输入或textarea元素?
我试图解决这个问题并用Google搜索,但没有找到任何相关的答案.请建议我在哪里做错了:
app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Hello {{name}}</h1>
<md-input-container>
<input md-input placeholder="Favorite food" value="Sushi">
</md-input-container>`,
styleUrls: [ './app/css/style.css' ],
})
export class AppComponent { name = 'Angular'; }
Run Code Online (Sandbox Code Playgroud)
app.module.ts:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { MaterialModule } from '@angular/material';
import { AppComponent } from './app.component';
// import 'hammerjs';
@NgModule({
imports: [ MaterialModule.forRoot(),BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ] …Run Code Online (Sandbox Code Playgroud) 我进行了很多探索,但是解决方案对我而言不起作用。我试图在我的代码中调用一个方法,但是它不起作用。没有发生错误,但click事件也无法正常工作。在我的代码中,我正在动态添加一个按钮,并且它已添加到我的代码中。但是,当我单击时Approved ,UnApproved则什么都没有发生。我正在使用<ng-table>,Approved并且UnApprovedbutton在<ng-table>指令中。请建议我我做错了什么?
我的代码是:
editData() {
this.data.forEach(function (row) {
if (row.isApproved) {
row.editButton = "<button (click)='approveUnApproveLeave()'>UnApproved</button>";
} else {
row.editButton = "<button (click)='approveUnApproveLeave()'>Approved</button>";
row.isApproved = row.isApproved.toString();
}
})
}
approveUnApproveLeave() {
console.log("approveUnApproveLeave called");
}
} // class closed
Run Code Online (Sandbox Code Playgroud)
请查看快照以更好地了解。
我是 hapijs 的新手,我正在制作一个演示应用程序,使用hapi-auth-basic. 但我的代码,( server.auth.strategy('simple', 'basic', { validateFunc: validate});)validate方法没有被调用,结果总是给出未经授权的结果,如下所示:
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing authentication"
}
Run Code Online (Sandbox Code Playgroud)
我想授权,有人可以建议我该怎么做以及我哪里做错了吗?
'use strict';
const Bcrypt = require('bcrypt');
const Hapi = require('hapi');
const Basic = require('hapi-auth-basic');
const server = new Hapi.Server();
server.connection({ port: 3000 });
const users = {
john: {
username: 'john',
password: '$2a$10$iqJSHD.BGr0E2IxQwYgJmeP3NvhPrXAeLSaGCj6IR/XU5QtjVu5Tm', // 'secret'
name: 'John Doe',
id: '2133d32a'
}
};
const validate = function (request, username, password, callback) {
const user = 'john';
console.log("1"); …Run Code Online (Sandbox Code Playgroud) 我正在使用 NGX-Schema-Form https://github.com/makinacorpus/ngx-schema-form来基于 json 对象渲染表单字段。
我的问题是:如何将自定义验证错误消息添加到我的架构中,以及如何在用户界面上正确显示它们(Bootstrap 4.1 based)。
以下是标准模式格式的示例:
注意: 模式、最小长度、最大长度
mySchema = {
"properties": {
"cellphoneNumber": {
"type": "string",
"title": "Cellphone number",
"placeholder": "e.g. 082 320 2121",
"widget": {
"id": "string"
},
"pattern": "^\\d{10}$",
"minLength": 5,
"maxLength": 12
}
}
Run Code Online (Sandbox Code Playgroud)
但我想做的是:
mySchema = {
"properties": {
"cellphoneNumber": {
"type": "string",
"title": "Cellphone number",
"placeholder": "e.g. 082 320 2121",
"widget": {
"id": "string"
},
pattern: {
value: '^\\d{10}$',
message: 'Cellphone number must be 10 digits'
},
minLength: …Run Code Online (Sandbox Code Playgroud) 我有运行在后端应用程序node.js与feathers.js框架。我已经使用docker部署了它,它目前由AWS ECS维护。
在我的应用程序中,我有几行'console.log'显示一些用于调试目的的字符串。我想知道何时将应用程序部署在AWS ECS上,console.log打印到何处以及如何访问它?
我有这个printValue变量,在我的角度组件中有一个HTML按钮代码,如下所示:
export class HomeComponent implements OnInit {
printValue = '<button type="button" data-toggle="popover" title="Popover Header" data-content="Some content inside the popover">Popover</button>';
constructor(){}
OnInit(){}
}
Run Code Online (Sandbox Code Playgroud)
问题是,一旦printValue变量放在innerHTML中,我如何使popover工作,如下所示:
<p [innerHTML]="printValue"></p>
Run Code Online (Sandbox Code Playgroud)
这样做
<body>
<button type="button" data-toggle="popover" title="Popover Header" data-content="Some content inside the popover">Popover</button>
</body>
Run Code Online (Sandbox Code Playgroud)
在html文件中直接启用popovers工作.但是如何使它在innerHTML属性中工作?
我有一个表格,其中一列显示一个链接,点击它会打开一个新页面。要显示我正在使用的特定链接:
`cellRenderer: "motorBikeType"`, under `this.columnDefs = [...`
Run Code Online (Sandbox Code Playgroud)
为了在列中显示不同的摩托车类型,我使用 , 中的agInit函数(正如我之前在此处回答的那样)motorBikeType component通过params.data.motorBikeType
这工作正常。表格显示正确,我得到了每种类型摩托车的一个很好的链接。
当我单击链接时,问题就开始了。在打开的新页面中(几乎是motorBikeType组件,params.node.data.motorBikeType不再可用。
如果我 console.log 它 - 我会在控制台中看到它。但它不会让我绑定到 html 视图motorBikeType
我什至尝试在类中创建一个局部变量,例如:
export class motorBikeType {
...
motorbike: any;
agInit(params: any): void {
this.params = params;
this.motorbike = params.data.motorBikeType;
}
}
Run Code Online (Sandbox Code Playgroud)
然后在 html 视图中:
<a *ngIf="... >{{params.data.motorBikeType}}</a>
<p *ngIf="...>{{params.data.motorBikeType}}</a>
Run Code Online (Sandbox Code Playgroud)
它只会在表格列中显示 link ,但是一旦它重定向到页面(我正在使用路由器),它就不会显示具有绑定值的段落。
我也试过里面ngOnInit() {...做this.motorbike = this.params.data.motorBikeType;
但它在视图中仍然没有约束力。
我需要的是params.data.motorBikeType在视图中显示。
像<p>{{params.data.motorBikeType}}或<p>{{motorbike}}</p>
谢谢。
const events = require('events');
const eventEmitter = new events.EventEmitter();
eventEmitter.on('scream', function() {
console.log("Screaming");
});
eventEmitter.on('scream', function(name) {
console.log(name+" is screaming");
});
eventEmitter.emit('scream', 'Bob');
Run Code Online (Sandbox Code Playgroud)
O/P:尖叫
鲍勃在尖叫
我的应用程序中有两个,component即:HeaderComponent& TestComponent。中HeaderComponent,有一个方法名称setUserData()。我从file 中的TestComponent 方法调用setUserDate()。ansSubmit()test.component.ts
现在setUserDate()正在召唤,价值正在进入setUserDate()方法。
问题是:调用时setUserDate(),我将分值设置为this.userData.score,并且this.userData.score值在视图( HTML )中绑定,但来自
TestComponent 的方法 ansSubmit() 的传入值不会在查看但该值存在于ts文件中(我正在控制台中打印)。
这是代码:
测试.组件.ts:
import { HeaderComponent } from '../../components/header/header.component';
@Component({
selector: 'test-page',
templateUrl: './test.component.html',
styleUrls: ['./test.component.css'],
providers: [HeaderComponent]
})
export class TestComponent implements OnInit {
private userData: any = {};
constructor(private _router: Router, private headerComponent: HeaderComponent) { }
ansSubmit() {
const …Run Code Online (Sandbox Code Playgroud) model angularjs-scope angular2-directives angular2-template angular
当我在Angular2(打字稿)中执行新的Date()时,我得到-> DATEE Wed Jul 18 2018 09:13:40 GMT + 0200
问题是我已将Date发送给Java,但是Java不允许这种格式。
Java只允许,dd / mm / aaaa或aaaaa / mm / dd,但他不允许Wed Jul 18 2018 09:13:40 GMT + 0200。
我尝试在Angular中创建新格式,但始终获取String,但是我需要格式化Date,因为我在Java中的类获取Date。
let myDate: Date, myDay, myMonth, myYear;
myDate = new Date();
myDay = myDate.setUTCFullYear;
console.log(myDay);
myDay = myDate.toISOString;
console.log(myDay);
console.log(typeof(myDay));
console.log(new Date(myDay));
Run Code Online (Sandbox Code Playgroud)
我无法安装默认情况下没有角度的库,例如:“ moment”。泰
angular ×7
node.js ×3
typescript ×3
ag-grid ×1
amazon ×1
amazon-ecs ×1
amazon-s3 ×1
click ×1
console.log ×1
date ×1
docker ×1
eventemitter ×1
forms ×1
hapi.js ×1
html ×1
javascript ×1
jsonschema ×1
model ×1
popover ×1