There is no way to dynamically add/remove directives by adding/removing a selector. The selector dragula
has to be static HTML for the directive to get applied. You can only use features of dragula to enable/disable it if it provides such a configuration option.
I haven't used ng2-dragula
or dragula
but I guess you can assign a dragModel
and configure it this way
<div class='container' dragula [dragulaModel]="dragulaModel">
dragulaModel = {start: function () {}};
and when you want to enable it, assign a model that doesn't disable start
enableDrag() {
this.dragulaModel = {};
}
Not tested, just skimmed a bit through the source.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…