在Angular2中允许更改输入属性而不进行脏检查

时间:2016-12-08 19:36:00

标签: angular dart angular-dart

我有使用set方法的组件:

@Input('message')
set messageFromSocket(String message) {check(details)}

该消息可能类似于某些实体已更新',并且多次从主机组件发出:

@View(
    template: "<message-view [message]='message' [details]='details'></message-view>")
class Example implements OnInit {
  @override
  Future ngOnInit() async {
  ...
    socket.stream.listen((String data) async {
      details = (JSON.decode(data) as Map);
      message = (details['Message'] as String);
    });
  }

每次主机中的消息更新时,如何运行messageFromSocket?

要点:https://gist.github.com/Rasarts/b67d841c184a8256671d44947ffdddd5

0 个答案:

没有答案