javascript - Angular Data Binding problems -
so want user coming portfolio enter first name on index.html page. welcome user on welcome page. how pass information index.html welcome.html. i'm novice @ angular, grateful!
index.html:
<header ng-controller="username myapp"> <form > <label><h1>enter first name: </h1></label> <input type="text" ng-model="user.name" name="clients" autofocus /> <button><a href="welcome.html">clickme</a></button> </form> <h1>{{user.name}}</h1> </header>
welcome.html:
<div class="container"> <div class="propic"></div> <div class="blurb">sfdvsdfvsdv <span ng-controller="firstctrl">{{data.message}}</span> fsdv sdfvsdfv sdf fs vsdfv sdfvf f vsdfv sdfv sfdv dsv fdv</div> </div>
app.js:
(function(){ var myapp = angular.module('myapp', []); myapp.controller('username', function(){ this.product = name; }); var user = { name: "" } });
here github: https://github.com/wiafe/portfolio
and here page: http://wiafe.github.io/portfolio/
ps: h1 that's being bind in index.html can ignored testing something.
Comments
Post a Comment