Forgive me for asking what may seem like a simple question. I am currently working on a demo quiz project using Angular. The first page features a basic two-way data binding greeting (where you input your name and it displays a welcome message, e.g.
<p> Welcome {{name}} </p>
I'm wondering how I can save the entered name and carry this welcoming message over to the next page/template. Here is a snippet of the code:
<strong>Welcome</strong> {{email}}
<p class="lead">Please enter your name </p>
<body ng-app ng-init="email = 'John';">
<label>enter name<input type="text" ng-model="firstName"/></label><br />
</body>
Here is the routing setup:
'use strict';
angular
.module('angularQuizApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.when('/about', {
templateUrl: 'views/about.html',
controller: 'AboutCtrl'
})
[...]
I began with a yeoman angular scaffold so I haven't made many changes yet. Thank you in advance, knowledgeable Angular experts!