Skip to content

Commit 488a2e3

Browse files
author
K.C. Hunter
committed
updating single page application links and code.
1 parent f6e10be commit 488a2e3

15 files changed

Lines changed: 1920 additions & 78 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Accio Code Tutorials: AngularJS#
22

3-
***Updated: 1-16-14***
3+
***Updated: 5-11-15***
44

55
This tutorial series for [AccioCode](https://www.youtube.com/user/CDPAdvertising "Accio Code on YouTube") will show how to use the basics of AngularJS. You will learn how to make a simple web page and a simple web application.
66

@@ -10,4 +10,6 @@ AngularJS is an open-source framework in JavaScript. It was created and maintain
1010
It is an MVC (Model-View-Controller) framework so a brief understanding of MVC is suggested, but not required, to use this tutorial.
1111

1212
## Course Videos ##
13-
1. [NgAnnotate and Minification](http://youtu.be/4waCqOuw3Tc "NgAnnotate and Minification")
13+
1. [Starting The Single Page Website](https://www.youtube.com/watch?v=V6unYD1QrAs "Starting the Single Page Website")
14+
2. [Setting Up Gulp]( "Setting Up Gulp")
15+
3. [Single Page AngularJS Navigation]( "Single Page AngularJS Navigation")

gulpfile.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
var gulp = require('gulp');
2+
var clean = require('gulp-clean');
3+
var concat = require('gulp-concat');
4+
var ngdocs = require('gulp-ngdocs');
5+
var sass = require('gulp-sass');
6+
var uglify = require('gulp-uglify');
7+
var runSequence = require('run-sequence');
8+
9+
var buildDir = 'bin/';
10+
var depsJS = ['bower_components/modernizr/modernizr.js',
11+
'bower_components/jquery/dist/jquery.min.js',
12+
'bower_components/bootstrap/dist/js/bootstrap.min.js',
13+
'bower_components/angularjs/angular.min.js',
14+
'bower_components/angular-route/angular-route.min.js'];
15+
var appJS = ['src/resources/js/general/app.js',
16+
'src/resources/js/general/modules.js',
17+
'src/resources/js/general/configs.js'];
18+
19+
/** tasks **/
20+
gulp.task('devDeps', function ()
21+
{
22+
var depsjs = gulp.src(depsJS);
23+
return depsjs.pipe(concat('mcu_deps.js'))
24+
.pipe(gulp.dest('src'));
25+
});
26+
27+
gulp.task('devJS', function ()
28+
{
29+
var js = gulp.src(appJS);
30+
return js.pipe(concat('mcu.js'))
31+
.pipe(gulp.dest('src'));
32+
});
33+
34+
/** initialize **/
35+
gulp.task('default', function (callback)
36+
{
37+
runSequence('devDeps', 'devJS', callback);
38+
});

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
"grunt-contrib-copy": "~0.7.0",
1515
"grunt-contrib-watch": "~0.6.1",
1616
"grunt-ngdocs": "~0.2.6",
17-
"grunt-ng-annotate": "~0.8.0"
17+
"grunt-ng-annotate": "~0.8.0",
18+
"gulp": "~3.8.11",
19+
"gulp-clean": "~0.3.1",
20+
"gulp-concat": "~2.5.2",
21+
"gulp-ngdocs": "~0.2.10",
22+
"gulp-sass": "~2.0.0",
23+
"gulp-uglify": "~1.2.0",
24+
"run-sequence": "~1.1.0"
1825
},
1926
"scripts": {
2027
"test": "echo \"Error: no test specified\" && exit 1"

src/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
<html lang="en">
33
<head>
4-
<title>AccioCode AngularJS Tutorial</title>
4+
<title>Accio Code AngularJS Tutorial - Marvel Cinematic Universe Fan Page</title>
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
77
<meta name="viewport" content="width=device-width, user-scalable=no">
8-
<script src="angularjstutorial-deps.js"></script>
9-
<script src="angularjstutorial.js"></script>
8+
<script src="mcu_deps.js"></script>
9+
<script src="mcu.js"></script>
1010

1111
<link rel="stylesheet" href="resources/css/angularjstutorial.css">
1212
</head>
@@ -27,14 +27,14 @@
2727

2828
<div class="collpase navbar-collapse" id="bs-example-navbar-collapse-1">
2929
<ul class="nav navbar-nav">
30-
<li data-ng-class="{active: isActive('/')}"><a href="/movies" title="Films">Films</a></li>
31-
<li data-ng-class="{active: isActive('/')}"><a href="/characters" title="Characters">Characters</a></li>
30+
<li data-ng-class="{active: isActive('/')}"><a href="#/films" title="Films">Films</a></li>
31+
<li data-ng-class="{active: isActive('/')}"><a href="#/characters" title="Characters">Characters</a></li>
3232
<li class="dropdown">
3333
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-exapnded="false">Phases</span class="caret"></span></a>
3434
<ul class="dropdown-menu" role="menu">
35-
<li><a href="/phase/one" title="Phase One">Phase One</a></li>
36-
<li><a href="/phase/two" title="Phase Two">Phase Two</a></li>
37-
<li><a href="/phase/three" title="Phase Three">Phase Three</a></li>
35+
<li><a href="#/phase1" title="Phase One">Phase One</a></li>
36+
<li><a href="#/phase2" title="Phase Two">Phase Two</a></li>
37+
<li><a href="#/phase3" title="Phase Three">Phase Three</a></li>
3838
</ul>
3939
</li>
4040
</ul>

src/mcu.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
(function (MCU, undefined)
2+
{
3+
/**
4+
* @ngdoc function
5+
* @name MCU
6+
* @id MCU
7+
* @description
8+
*
9+
* Set up our MCU website parameters for AngularJS.
10+
**/
11+
MCU.Version = "0.0.0";
12+
MCU.PartialsPath = "partials/";
13+
MCU.Factory = {};
14+
MCU.Modules = {};
15+
MCU.Configs = {};
16+
MCU.Controllers = {};
17+
MCU.Directives = {};
18+
19+
}(window.MCU = window.MCU || {} ));
20+
(function (Modules, undefined)
21+
{
22+
/**
23+
* @ngdoc object
24+
* @id MCU
25+
* @name MCU
26+
* @description
27+
*
28+
* This Module initializes the MCU Angular module.
29+
**/
30+
Modules.MCU = angular.module("mcu", ['ngRoute']);
31+
32+
}(MCU.Modules = MCU.Modules || {} ));
33+
(function (Configs, undefined)
34+
{
35+
MCU.Modules.MCU.config(['$routeProvider', function ($routeProvider)
36+
{
37+
$routeProvider
38+
.when('/', {
39+
templateUrl: MCU.PartialsPath + '/home.html'
40+
})
41+
.when('/films', {
42+
templateUrl: MCU.PartialsPath + '/films.html'
43+
})
44+
.when('/characters', {
45+
templateUrl: MCU.PartialsPath + '/characters.html'
46+
})
47+
.when('/phase1', {
48+
templateUrl: MCU.PartialsPath + '/phase1.html'
49+
})
50+
.when('/phase2', {
51+
templateUrl: MCU.PartialsPath + '/phase2.html'
52+
})
53+
.when('/phase3', {
54+
templateUrl: MCU.PartialsPath + '/phase3.html'
55+
})
56+
.otherwise({
57+
redirectTo: '/',
58+
templateUrl: MCU.PartialsPath + '/home.html'
59+
})
60+
}]);
61+
62+
}(MCU.Configs = MCU.Configs || {} ));

0 commit comments

Comments
 (0)