Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('myApp').directive('customDirective', ['$http', function ($http) {
- return {
- controller() {
- },
- compile(element) {
- const $fileinput = $('<input type="file" accept=".csv">').appendTo(element);
- return {
- controller: () => {
- $fileinput.on('change', (e) => {
- // Stuff happens
- });
- },
- link: () => {
- },
- };
- },
- };
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement