我有以下代码段
这是我的main.html
<h2 class="txtcenter po-2text" style="padding-top:30px">
{{title}}
</h2>
Run Code Online (Sandbox Code Playgroud)
这是我的主要内容:
title: string;
ngOnInit() {
var self = this;
var ref = firebase.database().ref('schools/' + this.currentUserId());
ref.orderByChild('title').on('value', function(dataSnapshot) {
console.log("Title is: " + dataSnapshot.val().title);
self.title = dataSnapshot.val().title;
});
}
Run Code Online (Sandbox Code Playgroud)
即使使用某些有效数据触发回调,标题也不会自动更新.我错过了什么?
任何帮助表示赞赏!
我有这个代码:
int * m = (int *)malloc(sizeof(int));
printf("%p %i\n", m, *m);
(*m) = 6;
printf("%p %i\n", m, *m);
free(m);
printf("%p %i\n", m, *m);
Run Code Online (Sandbox Code Playgroud)
我在Linux上运行它.为什么内存地址的值始终为0?
为什么我在Windows上运行它会改变这个值?