Permalink
Browse files

AngularJS introduced

  • Loading branch information...
tdziurko committed Feb 27, 2013
1 parent e32dd67 commit 9d135332ef5e934920a65975f41fb06f6cc852a8
Showing with 33 additions and 9 deletions.
  1. +18 −0 app/application.js
  2. +5 −3 home.html
  3. +5 −3 second.html
  4. +5 −3 third.html
View
@@ -0,0 +1,18 @@
+"use strict";
+
+angular.module("navbarapp", ["controllers"]);
+
+var controllers = angular.module("controllers", []);
+
+controllers.controller("HomePageCtrl", function HomePageCtrlHomePageCtrl($scope) {
+ $scope.pageName = "Home Page";
+});
+
+controllers.controller("SecondPageCtrl", function SecondPageCtrl($scope) {
+ $scope.pageName = "Second Page";
+});
+
+controllers.controller("ThirdPageCtrl", function ThirdPageCtrl($scope) {
+ $scope.pageName = "Third Page";
+});
+
View
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
+<html ng-app="navbarapp">
<head>
<meta charset="utf-8" />
<title>Twitter Bootstrap Navbar with AngularJS</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.css" />
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>
+ <script src="app/application.js"></script>
</head>
-<body>
+<body ng-controller="HomePageCtrl">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container">
@@ -27,7 +29,7 @@
</div>
<div class="container">
- <h1>Home Page</h1>
+ <h1>{{pageName}}</h1>
</div>
</body>
View
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
+<html ng-app="navbarapp">
<head>
<meta charset="utf-8" />
<title>Twitter Bootstrap Navbar with AngularJS</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.css" />
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>
+ <script src="app/application.js"></script>
</head>
-<body>
+<body ng-controller="SecondPageCtrl">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container">
@@ -27,7 +29,7 @@
</div>
<div class="container">
- <h1>Second Page</h1>
+ <h1>{{pageName}}</h1>
</div>
</body>
View
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
+<html ng-app="navbarapp">
<head>
<meta charset="utf-8" />
<title>Twitter Bootstrap Navbar with AngularJS</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.css" />
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>
+ <script src="app/application.js"></script>
</head>
-<body>
+<body ng-controller="ThirdPageCtrl">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container">
@@ -27,7 +29,7 @@
</div>
<div class="container">
- <h1>Third Page</h1>
+ <h1>{{pageName}}</h1>
</div>
</body>

0 comments on commit 9d13533

Please sign in to comment.