Skip to content

Instantly share code, notes, and snippets.

@samsamm777
Created October 10, 2017 13:00
Show Gist options
  • Save samsamm777/25f2b86454108ae37c038c792cdfda5f to your computer and use it in GitHub Desktop.
Save samsamm777/25f2b86454108ae37c038c792cdfda5f to your computer and use it in GitHub Desktop.
import { ApplicationService, NotificationService, WorkspaceService } from '../../core';
import { Component, OnInit } from '@angular/core';
import { FlixBaseComponent } from '../base/flixbase.component';
import { remote } from 'electron';
@Component({
selector: 'flx-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.scss']
})
export class FlxMainComponent extends FlixBaseComponent implements OnInit {
constructor(
public app: ApplicationService,
public workspace: WorkspaceService,
public notifier: NotificationService
) {
super(notifier);
}
ngOnInit() {
let fs = remote.require('fs');
// fs.readFile('../../../assets/bigbuck/0001.png', (err, data) => {
// if (err) throw err;
// console.log(data);
// });
fs.readdir('/home/sam/Desktop/assets', (err, dir) => {
for (var i = 0, path; path = dir[i]; i++) {
fs.readFile('/home/sam/Desktop/assets/' + path, (err, data) => {
if (err) throw err;
console.log(data);
});
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment