Blogular is a simple set of exercises to learn how to develop a web application using AngularJS
$ docker-compose up
$ npm i -g gulp bower nodemon
$ npm i
$ bower install
- Run the app: npm start
- Change Hello World to add your name using databinding
- Add a text input to set the name
- You do not need to use a js file
- Create your first controller to define your name in the home page
- Test the scope inheritance creating another controller
- Replace the hard coded list of articles by a dynamically loaded list using ng-repeat
- Use the databinding to get the data from the form to the controller
- Display the created object in the console
- Add the new article in the list of articles
- Use the controller inheritance to add the new article
- Use controllerAs in the HTML
- Add the new article in the list of articles
- Use event to add the new article
-
Fetch data from http
-
Create new articles using POST requests
-
GET: /api/articles to get the list of articles
-
POST: /api/articles to create a new article
- Use ngRoute to define your routes
- / for the home (and by default)
- /articles for the list of articles
-
Use the delete button to delete the article
-
DELETE: /api/articles/:id to delete an existing article
-
Create a new route to visualize and edit an article
-
GET: /api/articles/:id to get one article using its id
-
PUT: /api/articles/:id to update an existing article
- Add form validation on the modal
- title required
- content between 10 and 300 chars
- disable the create button when the form is invalid
- Create a service for the CRUD of articles
- Change the article service to use $resource
- Implement the update function using the PUT method
- Add filter do display date using a usual format
- Add a filter to display the title in uppercase
- Use the search input to filter the list of articles
- Bind category buttons to filter by category
- Use sort buttons to sort by title or by date
- Reverse the sort when clicking a second time on the same button
- Create a filter to display a default picture when the article has no picture set
- Use the ngSwitch directive to select the display mode (list / table)
- Create a custom directive to display articles in the list
- Setup a gulp task to serve an application
- Transform the service into a provider and create a method to set the api URL
- Replace ngRouter by ui-router
- Setup a view header and put the navbar inside it
- Use ui-router event to to display a loading animation
- Use optimization mechanisms to reduce the amount of watchers
- Use filters in controllers instead of views
-
Add a new route to display an article
-
In the resolve, chain promises to get all informations from an article
-
GET: /api/articles/:id to get the title, author, categories and date
-
GET: /api/articles/:id/content to get the content
-
GET: /api/articles/:id/picture to get the picture url
- Create a directive to display the list of categories
- Use transclusion to give the template
- Transform your directive to use it as a form element
- Create a sync validator to check the author name (should have a firstname and a lastname)
- Create an async validator to check (for new articles) if the title is already used
- Use angular-translate to display the site in two language (json files provided)
- Allow to change the language by clicking on the flag in the navbar
- The API is in the wrong format, use transformers to make the application works
- When getting a 401 http error, display the login modal
- The server ask for a csrf, change headers to make the form work
- Create a unit test for the ArticleController
- Create a unit test for both validators
- Create a unit test for the picture filter
- Create a unit test for the Article service
- Create an e2e test for the Articles page
Training created by Sylvain CAU
Follow me on Twitter @SylvainCau