A Pen by aaron k saunders on CodePen.
Created
February 13, 2015 23:25
-
-
Save aaronksaunders/2e77b1d3b0a07731c21d to your computer and use it in GitHub Desktop.
xbYLyB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html > | |
| <head lang="en"> | |
| <meta charset="UTF-8"> | |
| <title>Assignment 1</title> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.13/angular.js"></script> | |
| </head> | |
| <!-- specify the application AND the controller --> | |
| <body ng-app="starter" ng-controller="SimpleController"> | |
| <div> | |
| <input type="text" ng-model="mydata"/> | |
| <button ng-click-"mydata">Submit</button> | |
| <p>Input Data: {{mydata}}</p> | |
| </div> | |
| <div> | |
| <input type="text" ng-model="mydata"/> | |
| <button ng-click-"mydata">Submit</button> | |
| <p>Sub-Controller Input Data: {{mydata}}</p> | |
| </div> | |
| <!-- I want to put the current date here by calling an angular.js function, --> | |
| <!-- but I don't understand the syntax --> | |
| <!-- use the date scope value --> | |
| <h1>{{theDate}}</h1> | |
| <script> | |
| // the app module | |
| angular.module("starter",[]) | |
| // the controller | |
| .controller('SimpleController', function ($scope) { | |
| // set the scope value for the date | |
| $scope.theDate = new Date(); | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment