Skip to content

Feature/killer stuff #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,697 changes: 449 additions & 1,248 deletions .subl/angular-playground.sublime-workspace

Large diffs are not rendered by default.

31 changes: 18 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ module.exports = function(grunt) {
* stylesheet, and 'unit' contains our app's unit tests.
*/
app_files: {
js: ['src/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js'],
js: [
'src/**/*.index.js',
'src/app.js',
'src/**/*.js',
'!src/**/*.spec.js',
'!src/assets/**/*.js'
],
jsunit: ['src/**/*.spec.js'],

appTemplates: ['src/app/**/*.tpl.html'],
Expand Down Expand Up @@ -249,12 +255,12 @@ module.exports = function(grunt) {
banner: '<%= meta.banner %>'
},
src: [
'module.prefix',
'<%= build_dir %>/src/**/*.module.js',
'<%= build_dir %>/src/**/*.js',
'<%= html2js.common.dest %>',
'<%= build_dir %>/src/**/index.js',
'<%= build_dir %>/src/app/app.js',
'<%= build_dir %>/src/app/**/*.js',
'<%= build_dir %>/src/common/lib/**/*.js',
'<%= html2js.app.dest %>',
'module.suffix'
'<%= html2js.common.dest %>'
],
dest: '<%= compile_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.js'
},
Expand Down Expand Up @@ -426,13 +432,12 @@ module.exports = function(grunt) {
build: {
dir: '<%= build_dir %>',
src: [
'<%= vendor_files.js %>',
'<%= build_dir %>/src/**/*.module.js',
'<%= build_dir %>/src/**/*.js',
'<%= html2js.common.dest %>',
'<%= html2js.app.dest %>',
'<%= vendor_files.css %>',
'<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
'<%= vendor_files.js %>',
'<%= app_files.js %>',
'<%= html2js.common.dest %>',
'<%= html2js.app.dest %>',
'<%= vendor_files.css %>',
'<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
]
},

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ngbp

A simplified version of the ngBoilerplate angular project template.
A simplified version of the ngBoilerplate angular project template.

***

## Quick Start
## Quick Start
6 changes: 4 additions & 2 deletions src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
'ui.router',
'ui.bootstrap',
'smart-table',
'ngbp.tabs',
'LocalStorageModule',
'gettext'
'gettext',
'ngbp',
'ngbp.tabs',
'ngbp.gaia'
])));
38 changes: 0 additions & 38 deletions src/app/home/home.ctrl.js

This file was deleted.

32 changes: 31 additions & 1 deletion src/app/home/home.drv.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,41 @@
'use strict';
module.directive('homeSection', homeSection);

class baseController {
constructor() {
this.state = {};
}
}

class HomeController extends baseController {

constructor($timeout) {
super();
this.$timeout = $timeout;
}

changeRdy(key, data) {

if (angular.isArray(data) && !data.length) {
delete this.state[key];
}

this.$timeout(function(state) {
console.log('SEND to service:', state);
}, 0, true, this.state);
}

removeAlert(alert) {
delete this.state[alert];
console.log('send to service:', this.state);
}
}

function homeSection() {
return {
scope : {},
restrict : 'E',
controller : 'HomeController',
controller : HomeController,
controllerAs : 'vm',
bindToController: true,
templateUrl : 'home/home.tpl.html'
Expand Down
File renamed without changes.
25 changes: 23 additions & 2 deletions src/app/login/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
/**
* Created by RED-DRAGON on 20/09/2015.
*/
(function (module) {
(function(module) {
'use strict';

module.config(function ($stateProvider) {
// module.config(function($stateProvider) {
// $stateProvider.state('gaia', {
// url: '/gaia?id',
// views: {
// 'main': {
// template: '<animate-section></animate-section>'
// }
// },
// reloadOnSearch:false,
// resolve: {
// data: ($stateParams) => {
// console.log('hi',$stateParams.id);
// return $stateParams.id;
// }
// },
// data: {
// pageTitle: 'animate'
// }
// });
// });

module.config(function($stateProvider) {
$stateProvider.state('login', {
url: '/login',
views: {
Expand Down
36 changes: 36 additions & 0 deletions src/app/router/animate-dome.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div class="animate-section">
<div class="row">
<div class="col-md-12">
<form action="" class="form-inline">
<div class="form-group">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary" ng-class="{'active':vm.left}">
<input type="checkbox" ng-model="vm.left" ng-change="vm.right = false;" autocomplete="off"> Left
</label>
<label class="btn btn-primary" ng-class="{'active':vm.right}">
<input type="checkbox" ng-model="vm.right" ng-change="vm.left = false;" autocomplete="off"> Right
</label>
<label class="btn btn-primary">
<input type="checkbox" autocomplete="off" ng-model="vm.animate"> animate
</label>
</div>
<input type="text" class="form-control" ng-model="vm.url">
</div>
<button class="btn btn-danger" ng-click="vm.clickRoute(vm.url)">Change Url!</button>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="animate-if" ng-if="vm.animate" ng-class="{'right':vm.right,'left':vm.left}"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<ul class="list-group">
<li class="list-group-item" ng-class="{'active': vm.url-1 === $index}" ng-repeat="item in vm.items" ng-click="vm.clickRoute(item)">Item {{item}}
</li>
</ul>
</div>
</div>
</div>
66 changes: 66 additions & 0 deletions src/app/router/animateo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.animate-section {
position: relative;
// overflow: hidden;
height: 100%;
}

.right {
background-color: red;
}

.left {
background-color: green;
}
.animate-if {
height: 30px;
border: 1px solid #000;
border-radius: 5px;
width: 100%;
position:absolute;
right:0;
top:35px;
display: block;
}

.animate-if.right.ng-enter,
.animate-if.right.ng-leave {
transition: 400ms linear all;
}

.animate-if.right.ng-enter {
right: -100%;
}

.animate-if.right.ng-enter.animate-if.right.ng-enter-active {
right: 0;
}

.animate-if.right.ng-leave {
right: 0;
}

.animate-if.right.ng-leave.animate-if.right.ng-leave-active {
right: -100%;
}

.animate-if.left.ng-enter,
.animate-if.left.ng-leave {
transition: 400ms linear all;
}

.animate-if.left.ng-enter {
left: -100%;
}

.animate-if.left.ng-enter.animate-if.left.ng-enter-active {
left: 0;
}

.animate-if.left.ng-leave {
left: 0;
}

.animate-if.left.ng-leave.animate-if.left.ng-leave-active {
left: -100%;
}

30 changes: 30 additions & 0 deletions src/app/router/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Created by RED-DRAGON on 20/09/2015.
*/
(function(module) {
'use strict';

module.config(config);

function config($stateProvider) {
$stateProvider.state('gaia', {
url: '/gaia?id',
views: {
'main': {
template: '<animate-section></animate-section>'
}
},
reloadOnSearch: false,
resolve: {
data: ($stateParams) => {
console.log('hi', $stateParams.id);
return $stateParams.id;
}
},
data: {
pageTitle: 'animate'
}
});
}

})(angular.module('ngbp.gaia', ['ui.router']));
33 changes: 33 additions & 0 deletions src/app/router/router.drv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
(function() {
angular
.module('ngbp.gaia')
.component('animateSection', {
bindings: {},
controller: animateDomeCtrl,
controllerAs: 'vm',
templateUrl: 'router/animate-dome.tpl.html'
});

function animateDomeCtrl($state, $scope, $rootScope, $stateParams) {
const vm = this;

$scope.$on('$locationChangeSuccess', (event) => {
console.log('$locationChangeSuccess');
vm.url = $stateParams.id;
});

init();

function init() {
console.log('init!');
vm.url = $stateParams.id;
vm.items = [1,2,3,4];

}

vm.clickRoute = (url) => {
$state.go('.', { id: url });
};
}

})();
2 changes: 1 addition & 1 deletion src/app/tabs/tabs.module.js → src/app/tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
});
}


})(angular.module('ngbp.tabs', ['ui.router']));

2 changes: 1 addition & 1 deletion src/app/tabs/master-tab/tabs-detail/tabs-detail.drv.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

vm.tab = vm.getS({ id: $stateParams.id });
console.log(vm.tab);
// let newScope = $scope.$new();
let newScope = $scope.$new();

let destination = $element.find('section');

Expand Down
2 changes: 1 addition & 1 deletion src/app/yfiles/LevelOfDetailNodeStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
***************************************************************************/
(function() {
angular
.module('ngbp')
.module('ngbp.yfiles')
.factory('LevelOfDetailNodeStyle', function($templateCache) {

return yfiles.lang.Class('LevelOfDetailNodeStyle', {
Expand Down
2 changes: 1 addition & 1 deletion src/app/yfiles/ScopeGraphSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
***************************************************************************/
(function() {
angular
.module('ngbp')
.module('ngbp.yfiles')
.factory('ScopeGraphSource', function() {
return ScopeGraphSource;
});
Expand Down
Loading