O'Reilly logo

Serverless Single Page Apps by Ben Rady

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Profile View

An essential aspect of building modern web apps is informing users what information we have about them. A basic way to do this is just to show them all the information we have, so we’re going to do that in a new view called the profile view. We’ll create this view just like our other views, by adding a route and a view function. Start by adding the view function, like so:

 learnjs.profileView = ​function​() {
 var​ view = learnjs.template(​'profile-view'​);
  learnjs.identity.done(​function​(identity) {
  view.find(​'.email'​).text(identity.email);
  });
 return​ view;
 }

Next, you’ll need a view template. In this view template, add a simple header and a title.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required