Implementing the index View

For the index view, Listing 26.11 implements a very basic index page. The page only includes links to the logout and user views to allow you to access those views from the browser. Also, the <%=msg> EJS script element is included to display the message if one exists on the session. Figure 26.2 shows the rendered view.

Listing 26.11 index.html: Implementing the index EJS HTML template


01 <!doctype html>
02 <html ng-app="myApp">
03 <head>
04   <title>User Login and Sessions</title>
05   <link rel="stylesheet" type="text/css"
06       href="/static/css/styles.css" />
07 </head>
08 <body>
09   <div ng-controller="myController">
10     <h2>Welcome. You are Logged In as <%= username %></h2>
11     <a href="/logout">logout</a>
12     <a href="/user">Edit User</a>
13     <p>Place Your Code Here<p>
14   </div>
15   <hr><%= msg %>
16   <script src="http://code.angularjs.org/1.2.9/angular.min.js"></script>
17   <script src="/static/js/my_app.js"></script>
18 </body>
19 </html>


Image

Figure 26.2 The rendered index view allows you to log out and edit a user.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.102.249