0

I have a list of Markdown files in a folder that is copied over via Grunt, that I would like my AngularJS project to be able to list out in my view. (e.g. files 1.md, 2.md, 3.md in folder /foo/ -- I would like a list such as ["1.md","2.md","3.md"] to be used in the actual ng project.)

I figure this would require a Grunt job to be able to read the list of files in the folder, and dump the list of file names to a JSON object or something the Angular controller could read and bind.

I have tried various things and nothing seems to net quite what I want. If anyone has any ideas or can point me in the right direction that would be great!

Cheers~

1 Answer 1

1

Read files names: http://nodejs.org/api/fs.html#fs_fs_readdir_path_callback

Generate dump and append it to some JavaScript file: https://github.com/mattstyles/grunt-banner

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.