Skip to content

Commit c13c8d6

Browse files
committed
Refactored demo Landing controller to ES6
1 parent 4f74b49 commit c13c8d6

File tree

5 files changed

+60
-19
lines changed

5 files changed

+60
-19
lines changed
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
(function() {
2-
"use strict";
3-
4-
angular.module('app.controllers').controller('LandingController', LandingController);
5-
6-
function LandingController() {
1+
export class LandingController {
2+
constructor() {
73
var vm = this;
84

95
vm.laravel_description = 'Response macros integrated with your Angular app';
@@ -16,5 +12,4 @@
1612
*/
1713
vm.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
1814
}
19-
20-
})();
15+
}

angular/index.controllers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { LandingController } from './app/pages/landing/landing.controller';
2+
3+
angular.module('app.controllers').controller('LandingController', LandingController);

angular/index.main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import './index.modules';
44
//Config
55
import './index.config';
66

7+
//Controllers
8+
import './index.controllers';
9+
710
//Run
811
import './index.routes';
912

public/js/app.js

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@
5757

5858
__webpack_require__(5);
5959

60-
__webpack_require__(6);
61-
6260
__webpack_require__(7);
6361

62+
__webpack_require__(8);
63+
64+
__webpack_require__(9);
65+
6466
/***/ },
6567
/* 1 */
6668
/***/ function(module, exports) {
@@ -88,16 +90,54 @@
8890

8991
'use strict';
9092

91-
var _RoutesConfig = __webpack_require__(4);
93+
var _landing = __webpack_require__(4);
9294

93-
angular.module('app.routes').config(_RoutesConfig.RoutesConfig);
95+
angular.module('app.controllers').controller('LandingController', _landing.LandingController);
9496

9597
/***/ },
9698
/* 4 */
9799
/***/ function(module, exports) {
98100

99101
'use strict';
100102

103+
Object.defineProperty(exports, "__esModule", {
104+
value: true
105+
});
106+
107+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
108+
109+
var LandingController = exports.LandingController = function LandingController() {
110+
_classCallCheck(this, LandingController);
111+
112+
var vm = this;
113+
114+
vm.laravel_description = 'Response macros integrated with your Angular app';
115+
vm.angular_description = 'Query your API without worrying about validations';
116+
117+
/*
118+
This is a terrible temporary hack,
119+
to fix layout issues with flex on iOS (chrome & safari)
120+
Make sure to remove this when you modify this demo
121+
*/
122+
vm.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
123+
};
124+
125+
/***/ },
126+
/* 5 */
127+
/***/ function(module, exports, __webpack_require__) {
128+
129+
'use strict';
130+
131+
var _RoutesConfig = __webpack_require__(6);
132+
133+
angular.module('app.routes').config(_RoutesConfig.RoutesConfig);
134+
135+
/***/ },
136+
/* 6 */
137+
/***/ function(module, exports) {
138+
139+
'use strict';
140+
101141
Object.defineProperty(exports, "__esModule", {
102142
value: true
103143
});
@@ -133,19 +173,19 @@
133173
}
134174

135175
/***/ },
136-
/* 5 */
176+
/* 7 */
137177
/***/ function(module, exports) {
138178

139179
"use strict";
140180

141181
/***/ },
142-
/* 6 */
182+
/* 8 */
143183
/***/ function(module, exports) {
144184

145185
"use strict";
146186

147187
/***/ },
148-
/* 7 */
188+
/* 9 */
149189
/***/ function(module, exports) {
150190

151191
"use strict";

tasks/angular.task.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*Elixir Task
2-
*copyrights to https://github.com/HRcc/laravel-elixir-angular
3-
*/
2+
*copyrights to https://github.com/HRcc/laravel-elixir-angular
3+
*/
44
var gulp = require('gulp');
55
var concat = require('gulp-concat');
66
var sourcemaps = require('gulp-sourcemaps');
@@ -26,11 +26,11 @@ Elixir.extend('angular', function(src, output, outputFilename) {
2626
return gulp.src([baseDir + "index.main.js", baseDir + "**/*.js"])
2727
.pipe(eslint())
2828
.pipe(eslint.format())
29-
.pipe(gulpif(! config.production, sourcemaps.init()))
29+
.pipe(gulpif(!config.production, sourcemaps.init()))
3030
.pipe(webpack(webpackConfig))
3131
.pipe(ngAnnotate())
3232
.pipe(gulpif(config.production, uglify()))
33-
.pipe(gulpif(! config.production, sourcemaps.write()))
33+
.pipe(gulpif(!config.production, sourcemaps.write()))
3434
.pipe(gulp.dest(output || config.js.outputFolder))
3535
.pipe(notify({
3636
title: 'Laravel Elixir',

0 commit comments

Comments
 (0)