-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from marmelab/build-app
[RFR] Add build process
- Loading branch information
Showing
38 changed files
with
460 additions
and
416 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
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
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
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
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
<!doctype html> | ||
<html class="no-js"> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Angular admin</title> | ||
<meta name="viewport" content="width=device-width"> | ||
|
||
<link rel="stylesheet" href="scripts/bower_components/bootstrap/dist/css/bootstrap.css" /> | ||
<link rel="stylesheet" href="scripts/bower_components/fontawesome/css/font-awesome.css" /> | ||
<link rel="stylesheet" href="scripts/bower_components/humane/themes/flatty.css" /> | ||
|
||
<link rel="stylesheet" href="css/screen.css"> | ||
|
||
<script data-main="scripts/app" src="scripts/bower_components/requirejs/require.js"></script> | ||
<script src="build/ng-admin.min.js" type="text/javascript"></script> | ||
<script src="scripts/config.js" type="text/javascript"></script> | ||
</head> | ||
<body> | ||
<body ng-app="myApp"> | ||
<div ui-view></div> | ||
<div id="loader"></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 | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,61 @@ | ||
require.config({ | ||
waitSeconds: 30 | ||
paths: { | ||
'angular': 'bower_components/angular/angular', | ||
'angular-resource': 'bower_components/angular-resource/angular-resource', | ||
'angular-sanitize': 'bower_components/angular-sanitize/angular-sanitize', | ||
'angular-route': 'bower_components/angular-route/angular-route', | ||
'angular-ui-router': 'bower_components/angular-ui-router/release/angular-ui-router', | ||
'lodash': 'bower_components/lodash/dist/lodash.min', | ||
'text' : 'bower_components/requirejs-text/text', | ||
'angular-bootstrap': 'bower_components/angular-bootstrap/ui-bootstrap.min', | ||
'angular-bootstrap-tpls': 'bower_components/angular-bootstrap/ui-bootstrap-tpls.min', | ||
'restangular': 'bower_components/restangular/dist/restangular', | ||
'humane': 'bower_components/humane/humane', | ||
'nprogress': 'bower_components/nprogress/nprogress', | ||
|
||
'MainModule': 'app/Main/MainModule', | ||
'CrudModule': 'app/Crud/CrudModule' | ||
}, | ||
shim: { | ||
'angular': { | ||
exports: 'angular' | ||
}, | ||
'restangular': { | ||
deps: ['angular', 'lodash'] | ||
}, | ||
'angular-ui-router': { | ||
deps: ['angular'] | ||
}, | ||
'angular-bootstrap': { | ||
deps: ['angular'] | ||
}, | ||
'angular-bootstrap-tpls': { | ||
deps: ['angular', 'angular-bootstrap'] | ||
}, | ||
'jquery': { | ||
exports: '$' | ||
}, | ||
'angular-resource': { | ||
deps: ['angular'] | ||
}, | ||
'angular-sanitize': { | ||
deps: ['angular'] | ||
}, | ||
'angular-route': { | ||
deps: ['angular'] | ||
}, | ||
'nprogress': { | ||
exports: 'NProgress' | ||
} | ||
} | ||
}); | ||
|
||
require(['common', 'ng-admin'], function () { | ||
define(function(require) { | ||
"use strict"; | ||
|
||
require(['angular', 'MainModule', 'CrudModule'], function (angular) { | ||
|
||
angular.module('ng-admin', ['main', 'crud']); | ||
|
||
// we add the ng-app attribute for pure debugging purposes | ||
// historically, it was needed in case angular scenario was used for e2e tests | ||
document.body.setAttribute('ng-app', 'ng-admin'); | ||
var angular = require('angular'); | ||
require('MainModule'); | ||
require('CrudModule'); | ||
|
||
// async resource download implies async angular app bootstrap | ||
angular.bootstrap(document.body, ['ng-admin']); | ||
}); | ||
angular.module('ng-admin', ['main', 'crud']); | ||
}); |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,51 @@ | ||
define( | ||
[ | ||
'angular', | ||
'config', | ||
define(function (require) { | ||
"use strict"; | ||
|
||
'app/Crud/component/controller/ListController', | ||
'app/Crud/component/controller/FormController', | ||
'app/Crud/component/controller/DeleteController', | ||
var angular = require('angular'), | ||
ListController = require('app/Crud/component/controller/ListController'), | ||
FormController = require('app/Crud/component/controller/FormController'), | ||
DeleteController = require('app/Crud/component/controller/DeleteController'), | ||
|
||
'app/Crud/component/directive/InfinitePagination', | ||
InfinitePagination = require('app/Crud/component/directive/InfinitePagination'), | ||
|
||
'app/Crud/component/service/CrudManager', | ||
CrudManager = require('app/Crud/component/service/CrudManager'), | ||
|
||
'app/Crud/config/routing', | ||
routing = require('app/Crud/config/routing'); | ||
|
||
'angular-ui-router', 'angular-sanitize', 'angular-bootstrap-tpls' | ||
], | ||
function ( | ||
angular, | ||
config, | ||
require('angular-ui-router'); | ||
require('angular-sanitize'); | ||
require('angular-bootstrap-tpls'); | ||
|
||
ListController, | ||
FormController, | ||
DeleteController, | ||
var CrudModule = angular.module('crud', ['ui.router', 'ui.bootstrap', 'ngSanitize']); | ||
|
||
InfinitePagination, | ||
CrudModule.controller('ListController', ListController); | ||
CrudModule.controller('FormController', FormController); | ||
CrudModule.controller('DeleteController', DeleteController); | ||
|
||
CrudManager, | ||
CrudModule.service('CrudManager', CrudManager); | ||
|
||
routing | ||
) { | ||
"use strict"; | ||
CrudModule.directive('infinitePagination', InfinitePagination); | ||
|
||
var CrudModule = angular.module('crud', ['ui.router', 'ui.bootstrap', 'ngSanitize']); | ||
CrudModule.constant('config', config); | ||
/** | ||
* Date Picker patch | ||
* https://github.com/angular-ui/bootstrap/commit/42cc3f269bae020ba17b4dcceb4e5afaf671d49b | ||
*/ | ||
CrudModule.config(function($provide){ | ||
$provide.decorator('dateParser', function($delegate){ | ||
|
||
CrudModule.controller('ListController', ListController); | ||
CrudModule.controller('FormController', FormController); | ||
CrudModule.controller('DeleteController', DeleteController); | ||
var oldParse = $delegate.parse; | ||
$delegate.parse = function(input, format) { | ||
if ( !angular.isString(input) || !format ) { | ||
return input; | ||
} | ||
return oldParse.apply(this, arguments); | ||
}; | ||
|
||
CrudModule.service('CrudManager', CrudManager); | ||
|
||
CrudModule.directive('infinitePagination', InfinitePagination); | ||
|
||
/** | ||
* Date Picker patch | ||
* https://github.com/angular-ui/bootstrap/commit/42cc3f269bae020ba17b4dcceb4e5afaf671d49b | ||
*/ | ||
CrudModule.config(function($provide){ | ||
$provide.decorator('dateParser', function($delegate){ | ||
|
||
var oldParse = $delegate.parse; | ||
$delegate.parse = function(input, format) { | ||
if ( !angular.isString(input) || !format ) { | ||
return input; | ||
} | ||
return oldParse.apply(this, arguments); | ||
}; | ||
|
||
return $delegate; | ||
}); | ||
return $delegate; | ||
}); | ||
}); | ||
|
||
CrudModule.config(routing); | ||
CrudModule.config(routing); | ||
|
||
return CrudModule; | ||
} | ||
); | ||
return CrudModule; | ||
}); |
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
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
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
6 changes: 3 additions & 3 deletions
6
src/scripts/app/Crud/component/directive/InfinitePagination.js
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
Oops, something went wrong.