# Angular Auth Starter Kickstart your Citizen Engagement project by implementing a complete authentification workflow. This material is part of [web development courses](https://github.com/MediaComem/comem-webdev) for [Media Engineering](https://heig-vd.ch/formations/bachelor/filieres/ingenierie-des-medias). **You will need** * [Google Chrome][chrome] (recommended, any browser with developer tools will do) * [Sublime Text][sublime] (recommended, any code editor will do... **except Notepad**) **Recommended reading** * [Angular][ng] * [Angular UI Router][ng-router] --- ## First step .breadcrumbs[
Angular Auth Starter
] To start your project, you can clone the repository that contains a basic project structure. To do this, go to the directory that contains all your project, and use this command: ```bash $> git clone git@github.com:MediaComem/comem-webdev-angular-auth-starter.git ``` > You can also access directly the [GitHub page of the project][git-proj], and download a `.zip` file of the project. > If you do this, be sure to download a zip for the `master` branch. --- ## What is contained in the base project .breadcrumbs[
Angular Auth Starter
] This project already contains some basic structure. That is: * The `angular` framework * The `angular-ui-router` library * The `lodash`library *(not required, but could prove usefull for your project)* * The `moment` library *(not required, but could prove usefull for your project)* * The `Bootstrap CSS` framework * An `index.html` file that includes all preceding frameworks/libraires * An `app.js` file that contains: * The main `angular` module, named `app` * A `config` function attached to this `app` module with one predefined route, `home` * An almost blank `main.html` template, used by the `home` state --- ## The log in page .breadcrumbs[
Angular Auth Starter
] First, let's create an `html` template that will display a form, which we will use to log our user. In the `templates` directory, create a new file called `login.html` and put in the following code: ```html
Username
Password
Log in
``` > We will complete this template throughout the slides. --- ### Add the controller .breadcrumbs[
Angular Auth Starter
>
The log in page
] To control this page, i.e. the form, the button and the data, we will need a controller. In the `js` directory, create a new file called `login-ctrl.js`, and add in the following code: ```js angular.module('app').controller('LoginCtrl', function() { var login = this; }); ``` > Don't forget to add a `