Skip to content

Instantly share code, notes, and snippets.

@dhilst
Created February 16, 2018 02:31
Show Gist options
  • Select an option

  • Save dhilst/cc9d10b7807b0ba5c238c19dd6a665af to your computer and use it in GitHub Desktop.

Select an option

Save dhilst/cc9d10b7807b0ba5c238c19dd6a665af to your computer and use it in GitHub Desktop.
var module = angular.module('HelloWorldApp', []);
module.controller('HelloWorldController', function($scope){
$scope.name = "";
$scope.greeting = "World"
$scope.setName = function(){
$scope.greeting = $scope.name.toUpperCase();
};
})
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js"></script>
<script src="helloworld.js"></script>
</head>
<body ng-app="HelloWorldApp" ng-controller="HelloWorldController">
<p>Hello {{ greeting }}!!</p>
<input ng-model="name" ng-keyup="setName()">
</body>
</html>
{
"name": "helloworld",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"http-server": "^0.11.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment