我一直想知道是否可以通过用户进行<md-dialog>
拖拽..(在角度为网络)
我环顾四周,但没有找到关于这个主题的实质内容
这是整体结构..
<md-dialog>
<form>
<header></header>
<md-subheader>
<div>
<md-select>
<md-select-label>
</md-select-label>
<md-options>
</md-options>
</md-select>
</div>
</md-subheader>
<md-dialog-content>
<div>
<textarea>
<textarea>
</div>
<md-button>
</md-button>
</md-dialog-content>
</form>
</md-dialog>
答案 0 :(得分:8)
是的,您可以使用指令进行拖动并应用于md-dialog
以下是一个示例,
<md-dialog draggable>
<强>指令强>
routerApp.directive('draggable', function() {
return {
// A = attribute, E = Element, C = Class and M = HTML Comment
restrict: 'A',
//The link function is responsible for registering DOM listeners as well as updating the DOM.
link: function(scope, element, attrs) {
element.draggable({
stop: function(event, ui) {
console.log("Check if its printing")
event.stopPropagation();
}
});
}
};
});