mdlComponentNames function

List<String> mdlComponentNames (HtmlElement element)

Gives you all the component names registered for this element

Implementation

List<String> mdlComponentNames(final dom.HtmlElement element) {
    Validate.notNull(element);

    final List<String> names = new List<String>();

    var jsElement = new JsObject.fromBrowserObject(element);
    if(!jsElement.hasProperty(MDL_COMPONENT_PROPERTY)) {
        return names;
    }

    names.addAll((jsElement[MDL_COMPONENT_PROPERTY] as String).split(","));
    return names;
}