Skip to content

Commit

Permalink
ng-annotate support added
Browse files Browse the repository at this point in the history
  • Loading branch information
b091 committed Sep 23, 2015
1 parent 6040eaf commit 2aae32d
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 4 deletions.
5 changes: 4 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ gulp.task('compile', ['compile:src', 'compile:test']);

gulp.task('serve:docs', ['build:docs'], require('./tasks/server')(gulp, config.docsDir));
gulp.task('serve:e2e', require('./tasks/server')(gulp, __dirname, false, false));
gulp.task('serve:dist', ['build:dist'], require('./tasks/server')(gulp, __dirname, config.watchDir, true, 'index-packed.html'));
gulp.task('serve', ['compile:src'], require('./tasks/server')(gulp, __dirname, config.watchDir));

gulp.task('check:jshint', require('./tasks/jshint')(gulp, config));
Expand All @@ -37,7 +38,9 @@ gulp.task('test:unit', require('./tasks/test')(config.testDir));
gulp.task('test:e2e', ['serve:e2e'], require('./tasks/e2e')(gulp, config));
gulp.task('test', ['compile', 'test:unit', 'test:e2e']);

gulp.task('build:dist', require('./tasks/build')(gulp, config));
gulp.task('ng:annotate', ['compile:src'], require('./tasks/ngannotate')(gulp, config));

gulp.task('build:dist', ['ng:annotate'], require('./tasks/build')(gulp, config));
gulp.task('build:docs', require('./tasks/typedoc')(gulp, config));
gulp.task('build', ['build:dist', 'build:docs']);

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-jshint": "^1.11.2",
"gulp-ng-annotate": "^1.1.0",
"gulp-protractor": "^1.0.0",
"gulp-replace": "^0.5.4",
"gulp-tslint": "^3.2.0",
Expand Down
1 change: 1 addition & 0 deletions src/module/auth/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const module:ng.IModule = App.module("app.auth", []);
module.controller("Login", LoginCtrl);
module.controller("Logout", LogoutCtrl);

// @ngInject
module.config(($stateProvider:ng.ui.IStateProvider) => {
$stateProvider.state("login", {
url: "/login",
Expand Down
1 change: 1 addition & 0 deletions src/module/auth/LoginCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export class LoginCtrl {

public title:string;

// @ngInject
constructor(private $filter:ng.IFilterService, private $state:ng.ui.IStateService) {
this.title = "Login Panel";

Expand Down
1 change: 1 addition & 0 deletions src/module/dashboard/Dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const module:ng.IModule = App.module("app.dashboard", ["app.story"]);

module.controller("DashboardCtrl", DashboardCtrl);

// @ngInject
module.config(($stateProvider:angular.ui.IStateProvider) => {
$stateProvider.state("home", {
url: "/home",
Expand Down
1 change: 1 addition & 0 deletions src/module/dashboard/DashboardCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export class DashboardCtrl {
public title:string = "Dashboard";
public stories:Story[];

// @ngInject
constructor(private toastr:Toastr, private storyService:StoryService) {
toastr.success("Salute!", "Toastr fun!");
this.stories = storyService.model;
Expand Down
1 change: 1 addition & 0 deletions src/module/menu/MenuBoxDirective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class MenuBoxDirective implements ng.IDirective {
return null;
};

// @ngInject
constructor(private $location:ng.ILocationService, private $rootScope:ng.IScope) {

}
Expand Down
1 change: 1 addition & 0 deletions src/module/story/StoryBoxDirective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class StoryBoxDirective implements ng.IDirective {
});
};

// @ngInject
constructor(private $location:ng.ILocationService, private $rootScope:ng.IScope) {
// console.log("Dependency injection", $location, $rootScope);
}
Expand Down
1 change: 1 addition & 0 deletions src/module/story/StoryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export class StoryService {
public model:Story[] = [];
private moduleName:string = "stories";

// @ngInject
constructor(private endpointService:EndpointService, private $http:ng.IHttpService) {
}

Expand Down
1 change: 1 addition & 0 deletions src/module/toast/Toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "angular-toastr/angular-toastr.css!";

const module:ng.IModule = App.module("app.toast", ["toastr"]);

// @ngInject
module.config((toastrConfig:any) => {
App.extend(toastrConfig, {
templates: {
Expand Down
2 changes: 1 addition & 1 deletion tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function(gulp, config) {
var moduleName = 'app';
var buildConfig = {
format: 'amd',
minify: false,
minify: true,
sourceMaps: true
};
return builder.buildStatic(moduleName, outFile, buildConfig);
Expand Down
11 changes: 11 additions & 0 deletions tasks/ngannotate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';
module.exports = function(gulp, config) {
return function() {
var ngAnnotate = require('gulp-ng-annotate');
var path = require('path');

return gulp.src(path.join(config.srcDir, '**', '*.js'))
.pipe(ngAnnotate())
.pipe(gulp.dest(config.srcDir));
};
};
4 changes: 2 additions & 2 deletions tasks/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
module.exports = function(gulp, serverRootDir, watchDir, openBrowser) {
module.exports = function(gulp, serverRootDir, watchDir, openBrowser, fallback) {
var fs = require('fs');

return function() {
Expand All @@ -24,7 +24,7 @@ module.exports = function(gulp, serverRootDir, watchDir, openBrowser) {
enable: liveReload(),
filter: filterWatchFilesForLivereload
},
fallback: 'index.html',
fallback: 'index-packed.html',
open: openBrowser,
port: port
}));
Expand Down

0 comments on commit 2aae32d

Please sign in to comment.