Read CSV file content using Angular Directive.
This demo shows how to read a CSV file and get its content into scope by using angular .
Let's consider the view where we will be having Upload control and that's very simple code . Below would be the HTML file.
For Demo Purpose I am just copying all contents into scope .Choose your implementations according to Your need !!
Let's consider the view where we will be having Upload control and that's very simple code . Below would be the HTML file.
If you notice the accept attribute on file upload control above forces the browser to accept files type .CSV but again user can change it anytime and select another file . Have a validation for file type if you want to restrict to CSV only
Now Let's define the Controller File which reads the input type .
For Demo Purpose I am just copying all contents into scope .Choose your implementations according to Your need !!
Result of Code :
Comments
Post a Comment