how to call a jquery plugin from inside an angular.dart component?

前端 未结 1 1753
情歌与酒
情歌与酒 2021-01-20 07:04

I am learning about angular.dart components by trying to make one that will access an existing jquery plugin. I am trying something like the following:



        
1条回答
  •  [愿得一人]
    2021-01-20 07:25

    The problem seems to be a jQuery problem. Perhaps it would work with :

    var container = context.jQuery(shadowRoot.querySelector('.myContainer'));
    

    About dart:js versus package:js (see How do you interact with js from dart?) :

    package:js provides a simpler Api that comes at the cost of an increase of the js size (because package:js uses dart:mirrors and noSuchMethod).

    About js namespace you can do what you want. I personnaly prefer to use a prefix to better see when interaction with Js is done. But it's a matter of taste.

    0 讨论(0)
提交回复
热议问题