我有很多孩子这样的父母:
Parent:{
"childe1":"data",
"childe2":"data",
"childe3":"data",
"childe4":"data",
"childe5":"data"
}
Run Code Online (Sandbox Code Playgroud)
如何同时更新孩子[ childe1 , childe2 , childe3 ],防止其他任何用户同时更新?
我进行此路由配置
@RouteConfig([
{
path:'/profile/:id',name:'Profile',component:ProfileComponent
},
// else
{
path: '/**',
redirectTo: ['Home']
}
])
Run Code Online (Sandbox Code Playgroud)
并使用它来浏览参数为{id:5}的个人资料
<a [routerLink]="['Profile', {id:5}]" >Go </a>
Run Code Online (Sandbox Code Playgroud)
我添加到 index.html 这个基地
<base href="/">
Run Code Online (Sandbox Code Playgroud)
它成功导航到
http://localhost:3000/profile/1
Run Code Online (Sandbox Code Playgroud)
并且工作正常
但是当我在浏览器中粘贴相同的URL手册并点击输入时,给我这个错误
发生错误,因为未从根目录加载文件
http://localhost:3000
Run Code Online (Sandbox Code Playgroud)
但是浏览器试图将它们加载到相对URL目录中
http://localhost:3000/profile/1
Run Code Online (Sandbox Code Playgroud)
更新:我现在正在使用角度7,这种问题已解决,无需添加任何东西
当值改变时,星云checkbox.component.ts不会触发(change)事件。
在checkbox.component.ts应该有变化事件
<nb-radio
[value]="t"
(change)="onChange($event)"
*ngFor="let t of tList ">{{t}}</nb-radio>
</nb-radio-group>
Run Code Online (Sandbox Code Playgroud) 我有 Angular 2 组件包含 jquery 组件,我想为我的 Angular 2 组件的每个实例生成 id, 因为我需要为每个组件使用不同的 jquery 选择器
这是我的组件
@Component({
selector: 'full-calendar',
templateUrl: 'full-calendar.html'
})
export class FullCalendarComponent {
ngOnChanges(changes: any) {
$('angular2-fullcalendar').fullCalendar('option',changes.options.currentValue)
}
}Run Code Online (Sandbox Code Playgroud)
我想每次使用多个不同的选择器
我找到了这个解决方案
export class GetId {
protected getId(id: number|string = _.uniqueId()): string {
return _.lowerFirst(this.constructor.name) + '_' + id;
}
}
class MyComponent extends GetId {
...
}
Run Code Online (Sandbox Code Playgroud)
和 id 可以这样使用
<input [id]="getId('name')" type="text">
但我仍在寻找内置解决方案。
firebase 何时推送通知
firebaseAdmin.messaging().sendMulticast(message)
Run Code Online (Sandbox Code Playgroud)
我得到并错误
// Error: Requested entity was not found. at FirebaseMessagingError.FirebaseError [as constructor]
// code: "messaging/registration-token-not-registered", message: "Requested entity was not found."
Run Code Online (Sandbox Code Playgroud) 对于每个 API 请求,我在NodeJs服务器上有一些重要的字符串和对象的控制台日志。
我们已经将这些日志的副本移动到日志文件中。
这些对象的控制台日志是否会增加保留在控制台中的每个请求的内存使用量,例如,如果我们有 100 万个请求。
例如
console.log('some data here', new Date())
Run Code Online (Sandbox Code Playgroud)