Skip to content

Instantly share code, notes, and snippets.

@arildm
arildm / vueWrapper.js
Created October 14, 2024 15:06 — forked from BabOuDev/vueWrapper.js
AngularJS directive wrapper for VueJS components
import Vue from 'vue'
// the list of vue components to install
import components from './vueComponents'
class SlVueWrapper {
constructor($timeout) {
this.name = 'vue';
this.restrict = 'A';
this.terminal = true;
$('form :input').each(function(index, elem) {
var eId = $(elem).attr('id');
var label = null;
if (eId && (label = $(elem).parents('form').find('label[for='+eId+']')).length === 1) {
$(elem).attr('placeholder', $(label).html());
$(label).addClass('hide');
}
});