summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/web/gui/src/main/webapp/_sdh/ng-examples/ch05-02-log-example.html
blob: d516440d3611f8ed11b1c83c06c8bac133f4cac9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html ng-app="notesApp">
<head>
    <title>Notes App</title>
    <script src="../../tp/angular.js"></script>
</head>
<body ng-controller="MainCtrl as mainCtrl">

    <h1> Hello Services! </h1>
    <button ng-click="mainCtrl.logStuff()">Log something</button>

    <script type="text/javascript">
        angular.module('notesApp', [])
                .controller('MainCtrl', ['$log', function ($log) {
                    var self = this;
                    self.logStuff = function () {
                        $log.log('The button was pressed');
                    };
                }]);
    </script>
</body>
</html>