SHARE
TWEET

Untitled

a guest Oct 27th, 2016 121 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component } from '@angular/core';
  2.  
  3. const dialog = require("electron").dialog;
  4. const xml2js = require('xml2js');
  5. const fs = require("fs");
  6.  
  7. @Component({
  8.   selector: 'ct-config-editor',
  9.   templateUrl: 'config.editor.component.html'
  10. })
  11.  
  12. const ipc = require('electron').ipcRenderer;
  13.  
  14. const selectDirBtn = document.getElementById('select-file');
  15. alert("hello");
  16. selectDirBtn.addEventListener('click', function (event) {
  17.   ipc.send('open-file-dialog')
  18. })
  19.  
  20. ipc.on('selected-directory', function (event, path) {
  21.   document.getElementById('selected-file').innerHTML = `You selected: ${path}`
  22. })
  23.  
  24. export class ConfigEditorComponent {
  25.  
  26.  
  27.  
  28. }
  29.  
  30.  
  31. //Functions used for select server xml callbacks.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top