This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.filter('capitalize', function() { | |
return function(input, scope) { | |
if (input!=null) | |
input = input.toLowerCase(); | |
return input.substring(0,1).toUpperCase()+input.substring(1); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//requiring path and fs modules | |
const path = require('path'); | |
const fs = require('fs'); | |
//joining path of directory | |
const directoryPath = path.join(__dirname, 'Documents'); | |
//passsing directoryPath and callback function | |
fs.readdir(directoryPath, function (err, files) { | |
//handling error | |
if (err) { | |
return console.log('Unable to scan directory: ' + err); |