Why are my component bindings undefined in its controller?

前端 未结 9 1797
醉梦人生
醉梦人生 2021-01-31 13:22

I\'m writing a simple angular component. I\'m passing a parameter as a binding and display its value on the screen. All works fine: I can see the parameter being displayed on th

9条回答
  •  攒了一身酷
    2021-01-31 14:11

    Make sure you use hyphens for bindings in HTML and camelCase for bindings in Javascript.

    app.component("test", {
      bindings: {
        "myContactId": "<"
      }
    }
    
    
    

    That's what I always forget to do.

提交回复
热议问题