Answer the question
In order to leave comments, you need to log in
Why is this script not working?
<!DOCTYPE html>
<html lang="en" ng-app="helloWorldApp">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
<script>
var model = "Hello World";
var helloWorldApp = angular.module("helloWorldApp",[])
helloWorldApp.controller("helloWorldCtrl",function($scope){
$scope.message = model;
})
$scope.func = function($scope){
$scope.message = $scope.text
}
</script>
</head>
<body ng-controller="helloWorldCtrl">
<h1>{{message}}</h1>
<input type="text" ng-model="text">
<button ng-click="func()">Send</button>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question