The first thing which I am going to do is setting up local environment for Ionic by running below commands, before running commands make sure that you have already install Node.js 6 or later
Once the installation is successful, then to create a new project we need to use below ionic commands, here, the start command create a new project called “keysandstrokes” using sidemenu template, if you don’t specify any template type then it takes tabs template as a default template
$ionic start keysandstrokes sidemenu
Now, run below command to test ionic app, this command launches ionic app in the browser using 8100 port number
Step 2: Creating Ionic Provider
We need to create Ionic provider which is kind of service in Angular 4, this ionic provider will make a request to the rest API and get the response in the form of JSON, the article Ionic page will consume this provider to display list of articles using ion-card component
$ionic generate provider article
Once, the command is successfully executed then go to providers folder and open the article.ts file then replace the existing code with below one
Generated class for the ArticleProvider provider.
To add our recently created page in the sidemenu we need to edit app.component.ts file which is under app folder, here, I have deleted existing ListPage and added new ArticlesPage to the pages JSON array
A technology enthusiast and a professional blogger from India. Through out my IT career, I have had the pleasure of working on various new technologies and built products like www.ziprides.com and some other products. Unfortunately, my attempts have not given me the desired results and as a result, I have finally decided to build a professional blog where I would like to share all my learnings and hoping to learn from other enthusiasts around the world.