-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AngularJS Tutorial Part 1 - Creating a Hello World App
- Loading branch information
1 parent
20d6e94
commit 14dc5a4
Showing
5 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,6 @@ | |||
# lsh_angularjs_tutorial | # lsh_angularjs_tutorial | ||
LSH: AngularJS tutorial | LSH: AngularJS tutorial | ||
|
|||
These codes are part of an introduction to AngularJS tutorial by [Aashni Shah](http://www.aashni.me). | |||
|
|||
You can access the complete tutorial [here](http://blog.aashni.me/2016/08/angularjs-an-introduction/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
var angularApp = angular.module('AngularApp', ['ngRoute']); | |||
|
|||
angularApp.config(['$routeProvider', | |||
function($routeProvider){ | |||
$routeProvider | |||
.when('/', { | |||
templateUrl : 'views/main.html', | |||
controller : 'MainCtrl', | |||
controllerAs : 'main' | |||
}) | |||
.otherwise('/'); | |||
} | |||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
angularApp.controller('MainCtrl', [ | |||
'$scope', | |||
function($scope){ | |||
$scope.heading = "Hello World"; | |||
$scope.message = "This is me"; | |||
} | |||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
<!DOCTYPE html> | |||
<html ng-app="AngularApp"> | |||
<head> | |||
<title>Star Wars App</title> | |||
|
|||
<!-- include AngualrJS js --> | |||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-route.min.js"></script> | |||
|
|||
<!-- our files --> | |||
<script type="text/javascript" src="app.js"></script> | |||
|
|||
<!-- Controllers --> | |||
<script type="text/javascript" src="controllers/main.js"></script> | |||
|
|||
</head> | |||
<body> | |||
|
|||
<div ng-view></div> | |||
|
|||
</body> | |||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
<h1>{{ heading }}</h1> | |||
<p>{{ message }}</h1> |