From 8cd5ba377fee2966bedbcd91ce69fc163e15d445 Mon Sep 17 00:00:00 2001 From: jeremythi Date: Wed, 24 Jan 2018 10:12:13 +0100 Subject: [PATCH 1/2] exo03 jusqu'a part 2 etape6 --- project/.jshintrc | 1 - project/app.js | 12 +++++++- project/app.less | 3 ++ project/index.html | 6 +++- .../exo03/detail-partial/detail.controller.js | 15 ++++++++++ .../src/app/exo03/detail-partial/detail.html | 9 ++++++ .../src/app/exo03/detail-partial/detail.less | 0 project/src/app/exo03/exo03.controller.js | 24 +++++++++++++++ project/src/app/exo03/exo03.html | 11 +++++++ project/src/app/exo03/exo03.less | 29 +++++++++++++++++++ 10 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 project/src/app/exo03/detail-partial/detail.controller.js create mode 100644 project/src/app/exo03/detail-partial/detail.html create mode 100644 project/src/app/exo03/detail-partial/detail.less create mode 100644 project/src/app/exo03/exo03.controller.js create mode 100644 project/src/app/exo03/exo03.html create mode 100644 project/src/app/exo03/exo03.less diff --git a/project/.jshintrc b/project/.jshintrc index 2d54134..0f70040 100644 --- a/project/.jshintrc +++ b/project/.jshintrc @@ -5,7 +5,6 @@ "eqeqeq": true, "eqnull": true, "immed": true, - "indent": 2, "latedef": "nofunc", "newcap": true, "noarg": true, diff --git a/project/app.js b/project/app.js index d535909..2955db1 100644 --- a/project/app.js +++ b/project/app.js @@ -20,9 +20,19 @@ controller: 'HomeCtrl', controllerAs: 'home', }) + .when('/exo03', { + templateUrl: 'src/app/exo03/exo03.html', + controller: 'Exo03Ctrl', + controllerAs: 'exo03', + }) + .when('/exo03/detail-partial', { + templateUrl: 'src/app/exo03/detail-partial/detail.html', + controller: 'detailCtrl', + controllerAs: 'detail', + }) .otherwise({redirectTo:'/'}); } - + function RunUtils($rootScope) { $rootScope.safeApply = function(fn) { var phase = $rootScope.$$phase; diff --git a/project/app.less b/project/app.less index bf7b7df..266f491 100644 --- a/project/app.less +++ b/project/app.less @@ -4,6 +4,9 @@ @import "variables.less"; /* Add App LESS files below */ @import "src/app/home/home.less"; +@import "src/app/exo03/exo03.less"; +@import "src/app/exo03/detail-partial/detail.less"; + /* Add Fonts below */ @fa-font-path: "bower_components/font-awesome/fonts"; diff --git a/project/index.html b/project/index.html index 2421968..dcc6ca4 100644 --- a/project/index.html +++ b/project/index.html @@ -28,8 +28,12 @@ - + + + + +
diff --git a/project/src/app/exo03/detail-partial/detail.controller.js b/project/src/app/exo03/detail-partial/detail.controller.js new file mode 100644 index 0000000..bd4d224 --- /dev/null +++ b/project/src/app/exo03/detail-partial/detail.controller.js @@ -0,0 +1,15 @@ +(function() { + 'use strict'; + + function DetailCtrl() { + var vm = this; + vm.msg = 'Welcome All!'; + vm.subMsg = 'A seed Project'; + } + + DetailCtrl.$inject = []; + + angular.module('daproject') + .controller('DetailCtrl', DetailCtrl); + +})(); diff --git a/project/src/app/exo03/detail-partial/detail.html b/project/src/app/exo03/detail-partial/detail.html new file mode 100644 index 0000000..208d3fc --- /dev/null +++ b/project/src/app/exo03/detail-partial/detail.html @@ -0,0 +1,9 @@ +
+
+ {{detail.msg}} +
+
+

{{ LETITREDUFILMSELECTIONE }}

+

{{ LANNEEDUFILMSELECTIONE }}

+
+
\ No newline at end of file diff --git a/project/src/app/exo03/detail-partial/detail.less b/project/src/app/exo03/detail-partial/detail.less new file mode 100644 index 0000000..e69de29 diff --git a/project/src/app/exo03/exo03.controller.js b/project/src/app/exo03/exo03.controller.js new file mode 100644 index 0000000..7a82403 --- /dev/null +++ b/project/src/app/exo03/exo03.controller.js @@ -0,0 +1,24 @@ +(function() { + 'use strict'; + + function Exo03Ctrl() { + var vm = this; + vm.films = [ + {name: 'Fast and Furious', img: 'https://image.tmdb.org/t/p/w600_and_h900_bestv2/AkSMd8AXSpA1L1SbBPc2AfVJfmE.jpg', year: 2001, selected: false}, + {name: '2 Fast 2 Furious', img: 'https://image.tmdb.org/t/p/w600_and_h900_bestv2/u1Snfl40rXmAJNiMyZUczUyFVuf.jpg', year: 2003, selected: false}, + {name: 'Fast & Furious: Tokyo Drift', img: 'https://image.tmdb.org/t/p/w600_and_h900_bestv2/4ceW7kWPAc2uFG5WzYDbP8Od3gw.jpg', year: 2006, selected: false} + ]; + vm.clickin = clickin; + vm.saveIndex = -1; + function clickin(index){ + + vm.saveIndex = index; + } + } + + Exo03Ctrl.$inject = []; + + angular.module('daproject') + .controller('Exo03Ctrl', Exo03Ctrl); + +})(); \ No newline at end of file diff --git a/project/src/app/exo03/exo03.html b/project/src/app/exo03/exo03.html new file mode 100644 index 0000000..d315ccb --- /dev/null +++ b/project/src/app/exo03/exo03.html @@ -0,0 +1,11 @@ +
+
+
  • +
    +
    + + + truc truc + +
    +
    diff --git a/project/src/app/exo03/exo03.less b/project/src/app/exo03/exo03.less new file mode 100644 index 0000000..284e2b8 --- /dev/null +++ b/project/src/app/exo03/exo03.less @@ -0,0 +1,29 @@ + + +#pageFilms { + display: flex; + +} + +#listeFilms { + flex-direction: row; + height: 500px; + flex-grow: 1; +} + +#detailFilm { + + flex-direction: row-reverse; + height: 500px; + flex-grow: 1; +} + +.couleurDiv { + background-color: #6fed12 + +} + +.selected{ + border: 5px solid pink; +} + From 39aa9e5543d3394487eb4dfa8c92652c2ae20041 Mon Sep 17 00:00:00 2001 From: jeremythi Date: Wed, 24 Jan 2018 17:29:18 +0100 Subject: [PATCH 2/2] exo04 jusqu'a etape 05 --- project/app.js | 5 +++++ project/app.less | 2 ++ project/index.html | 7 +++++-- project/src/app/exo04/exo04.controller.js | 20 +++++++++++++++++++ project/src/app/exo04/exo04.html | 9 +++++++++ project/src/app/exo04/exo04.less | 19 ++++++++++++++++++ project/src/app/home/home.html | 4 ++-- .../src/components/setting/setting.service.js | 17 ++++++++++++++++ 8 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 project/src/app/exo04/exo04.controller.js create mode 100644 project/src/app/exo04/exo04.html create mode 100644 project/src/app/exo04/exo04.less create mode 100644 project/src/components/setting/setting.service.js diff --git a/project/app.js b/project/app.js index 2955db1..4c0d9eb 100644 --- a/project/app.js +++ b/project/app.js @@ -30,6 +30,11 @@ controller: 'detailCtrl', controllerAs: 'detail', }) + .when('/exo04', { + templateUrl: 'src/app/exo04/exo04.html', + controller: 'Exo04Ctrl', + controllerAs: 'exo04', + }) .otherwise({redirectTo:'/'}); } diff --git a/project/app.less b/project/app.less index 266f491..3ea7e11 100644 --- a/project/app.less +++ b/project/app.less @@ -5,6 +5,8 @@ /* Add App LESS files below */ @import "src/app/home/home.less"; @import "src/app/exo03/exo03.less"; +@import "src/app/exo04/exo04.less"; + @import "src/app/exo03/detail-partial/detail.less"; diff --git a/project/index.html b/project/index.html index dcc6ca4..1b20fa7 100644 --- a/project/index.html +++ b/project/index.html @@ -28,9 +28,12 @@ - - + + + + + diff --git a/project/src/app/exo04/exo04.controller.js b/project/src/app/exo04/exo04.controller.js new file mode 100644 index 0000000..0cb364a --- /dev/null +++ b/project/src/app/exo04/exo04.controller.js @@ -0,0 +1,20 @@ +(function() { + 'use strict'; + + function Exo04Ctrl($location){ + var vm = this; + vm.text = 'Text'; + vm.afficherText = afficherText; + + function afficherText(){ + console.log(vm.text) + } + + } + + Exo04Ctrl.$inject = []; + setting.service.settingService.$inject = []; + + angular.module('daproject') + .controller('Exo04Ctrl', Exo04Ctrl); +})(); \ No newline at end of file diff --git a/project/src/app/exo04/exo04.html b/project/src/app/exo04/exo04.html new file mode 100644 index 0000000..d37053a --- /dev/null +++ b/project/src/app/exo04/exo04.html @@ -0,0 +1,9 @@ +
    +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/project/src/app/exo04/exo04.less b/project/src/app/exo04/exo04.less new file mode 100644 index 0000000..214fc71 --- /dev/null +++ b/project/src/app/exo04/exo04.less @@ -0,0 +1,19 @@ + + +#container { + display: flex; + justify-content: center; + margin-top: 10px; + align-items: center; +} + +.buttonClick { + order: 1; +} +.inputText { + order: 2; + +} +.labelSearch { + order: 3; +} \ No newline at end of file diff --git a/project/src/app/home/home.html b/project/src/app/home/home.html index d56df2f..0be990c 100644 --- a/project/src/app/home/home.html +++ b/project/src/app/home/home.html @@ -6,8 +6,8 @@
    {{home.subMsg}}
    Exo03 - Exo05 - Exo06 + Exo04 + diff --git a/project/src/components/setting/setting.service.js b/project/src/components/setting/setting.service.js new file mode 100644 index 0000000..921378b --- /dev/null +++ b/project/src/components/setting/setting.service.js @@ -0,0 +1,17 @@ +(function() { + 'use strict'; + + function settingService() { + var service = {}; + service.city = ''; + service.isCelsius = true; + + return service; + } + + settingService.$inject = []; + + angular.module('daproject') + .factory('settingService', settingService); + +})(); \ No newline at end of file