AngularJS: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


== Example ==
== Example ==
<source lang="html">
<source lang="html4strict">
<!DOCTYPE html>
<!DOCTYPE html>
<html ng-app="exampleApp" >
<html ng-app="exampleApp" >

Revision as of 15:19, 25 May 2015

Good tutorials:

Example

<!DOCTYPE html>
<html ng-app="exampleApp" >
<head>
    <title>AngularJS Demo</title>
    <link href="bootstrap.css" rel="stylesheet" />
    <link href="bootstrap-theme.css" rel="stylesheet" />
    <script src="angular.js"></script>
    <script>
 
        var myApp = angular.module("exampleApp", []);
 
        myApp.controller("dayCtrl", function ($scope) {
            // controller statements will go here
        });
 
    </script>
</head>
<body>
    <div class="panel" ng-controller="dayCtrl">
        <div class="page-header">
            <h3>AngularJS App</h3>
        </div>
        <h4>Today is {{day || "(unknown)"}}</h4>
    </div>
</body>
</html>