Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
Balwinder Katoch committed Dec 14, 2015
1 parent d0e683e commit 30fffb4
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 11 deletions.
3 changes: 2 additions & 1 deletion app/app.module.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference path="../typings/angularjs/angular.d.ts" />
var avam;
(function (avam) {
'use strict';
angular.module("avam", ["avamUI"]);
angular.module("avam", ["avamUI", 'ui.router']);
})(avam || (avam = {}));
3 changes: 2 additions & 1 deletion app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference path="../typings/angularjs/angular.d.ts" />
module avam{
'use strict';
angular.module("avam", ["avamUI"]);
angular.module("avam", ["avamUI",'ui.router']);
}
7 changes: 5 additions & 2 deletions dist/avamUI.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ var avam;
var ui;
(function (ui) {
var AvamUIModelController = (function () {
function AvamUIModelController(scope, rootScope, ngWin, ngTimeout) {
function AvamUIModelController(scope, rootScope, ngWin, ngTimeout, stateService) {
var _this = this;
this.scope = scope;
this.rootScope = rootScope;
this.ngWin = ngWin;
this.ngTimeout = ngTimeout;
this.stateService = stateService;
this.isMenuVisible = true;
this.isMenuButtonVisible = false;
this.route = "";
Expand All @@ -27,6 +28,7 @@ var avam;
_this.checkWidth();
_this.broadcastMenuState();
}, 0);
this.onRouteChanged();
}
AvamUIModelController.prototype.checkWidth = function () {
var width = Math.max($(this.ngWin).width(), this.ngWin.innerWidth);
Expand All @@ -44,6 +46,7 @@ var avam;
var _this = this;
this.scope.$on('AVAM-MENU-ITEM-CHANGED', function (evt, data) {
_this.route = data.route;
_this.stateService.state(_this.route);
});
};
AvamUIModelController.prototype.onOrientationChange = function () {
Expand All @@ -55,7 +58,7 @@ var avam;
this.isMenuVisible = !this.isMenuVisible;
this.broadcastMenuState();
};
AvamUIModelController.$inject = ['$scope', '$rootScope', '$window', '$timeout'];
AvamUIModelController.$inject = ['$scope', '$rootScope', '$window', '$timeout', ' $state'];
return AvamUIModelController;
})();
ui.AvamUIModelController = AvamUIModelController;
Expand Down
2 changes: 1 addition & 1 deletion dist/avamUI.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ var avam;
var ui;
(function (ui) {
'use strict';
angular.module("avamUI", ["avam-menu"]);
angular.module("avamUI", ["avam-menu", "ui.router"]);
})(ui = avam.ui || (avam.ui = {}));
})(avam || (avam = {}));
2 changes: 2 additions & 0 deletions gulpfile.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var GulpConfig = (function () {
this.templatePath = "./src/*.html";
this.jsFilePath = "./dist/*.js";
this.moduleName = 'avamUI';
this.appFiles = './app/*.ts';
this.appPath = './app/';
}
return gulpConfig;
})();
Expand Down
8 changes: 8 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ gulp.task('compile:ts', function(){

gulp.task('watch', function(){
gulp.watch(gulpConfig.typeScriptSourceFiles, ['clean','compile:ts']);
});

gulp.task('app', function(){
return gulp.src(gulpConfig.appFiles)
.pipe(ts({
noImplicitAny: true
}))
.pipe(gulp.dest(gulpConfig.appPath));
});
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<avam-ui title="AVAM" sub-title="A Framework Framework"
icon-file="app/assets/images/logo.jpg">
<avam-menu allow-toggle="true" orientation="horizontal">
<avam-menu-item label="Dashboard" icon="glyphicon-dashboard" route="Dashboard"></avam-menu-item>
<avam-menu-item label="Income Statement" icon="glyphicon-phone" route="Income Statement"></avam-menu-item>
<avam-menu-item label="Dashboard" icon="glyphicon-dashboard" route="home"></avam-menu-item>
<avam-menu-item label="Income Statement" icon="glyphicon-phone" route="incomestatement"></avam-menu-item>
<avam-menu-item label="Help" icon="glyphicon-phone-alt" route="Help"></avam-menu-item>
<avam-menu-group label="Sub Menu" icon="glyphicon-cd">

Expand All @@ -31,6 +31,7 @@
<script src="lib/jquery/dist/jquery.js"></script>
<script src="lib/angular/angular.js"></script>
<script src="lib/angular-animate/angular-animate.js"></script>
<script src="lib/angular-ui-router/release/angular-ui-router.js"></script>

<script src="lib/avam-menu/dist/avam-menu.js"></script>

Expand All @@ -39,6 +40,7 @@
<script src="dist/avamUI.controller.js"></script>

<script src="app/app.module.js"></script>
<script src="app/app.route.js"></script>

</body>

Expand Down
7 changes: 5 additions & 2 deletions src/avamUI.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ module avam.ui{
isMenuButtonVisible:boolean=false;
route:string="";

static $inject =['$scope', '$rootScope', '$window','$timeout'];
static $inject =['$scope', '$rootScope', '$window','$timeout',' $state'];
constructor(private scope : IIAvamUIScope, private rootScope: ng.IRootScopeService,
private ngWin : ng.IWindowService, private ngTimeout : ng.ITimeoutService){
private ngWin : ng.IWindowService, private ngTimeout : ng.ITimeoutService,
private stateService: ng.ui.IStateService){
$(window).on('resize.avam',(evt: JQueryEventObject, args:any[]):any=>
{
this.scope.$apply(()=>{
Expand All @@ -43,6 +44,7 @@ module avam.ui{
this.checkWidth();
this.broadcastMenuState();
},0);
this.onRouteChanged();
}
checkWidth():void{
var width = Math.max($(this.ngWin).width(), this.ngWin.innerWidth);
Expand All @@ -61,6 +63,7 @@ module avam.ui{
onRouteChanged():void{
this.scope.$on('AVAM-MENU-ITEM-CHANGED', (evt: ng.IAngularEvent, data:any):void=>{
this.route=data.route;
this.stateService.state(this.route);
});
}
onOrientationChange(): void{
Expand Down
2 changes: 1 addition & 1 deletion src/avamUI.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module avam.ui{
'use strict';
angular.module("avamUI", ["avam-menu"]);
angular.module("avamUI", ["avam-menu", "ui.router"]);
}
3 changes: 2 additions & 1 deletion src/avamUI.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
</div>
</div>
</div>
<div ng-transclude ng-show="vm.isMenuVisible"></div>
<div ng-transclude ng-show="vm.isMenuVisible"></div>
<div ui-view>View</div>

0 comments on commit 30fffb4

Please sign in to comment.