├── .gitignore ├── angular-element ├── 3rdpartylicenses.txt ├── assets │ ├── .gitkeep │ └── data.json ├── elements.js ├── favicon.ico ├── index.html ├── main-es2015.js ├── main-es5.js ├── polyfills-es2015.js ├── polyfills-es5.js ├── runtime-es2015.js ├── runtime-es5.js └── scripts.js ├── image-slider-finished ├── .editorconfig ├── README.md ├── angular.json ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json ├── elements.js.gz ├── index.html ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app.module.ts │ │ ├── data.service.spec.ts │ │ ├── data.service.ts │ │ └── slider │ │ │ ├── result.ts │ │ │ ├── slider.component.css │ │ │ ├── slider.component.html │ │ │ ├── slider.component.spec.ts │ │ │ └── slider.component.ts │ ├── assets │ │ ├── .gitkeep │ │ └── data.json │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tsconfig.json └── tslint.json ├── image-slider ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app.module.ts │ │ ├── data.service.ts │ │ └── slider │ │ │ ├── result.ts │ │ │ ├── slider.component.css │ │ │ ├── slider.component.html │ │ │ ├── slider.component.spec.ts │ │ │ └── slider.component.ts │ ├── assets │ │ ├── .gitkeep │ │ └── data.json │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tsconfig.json └── tslint.json └── package-lock.json /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist/ 5 | tmp/ 6 | out-tsc/ 7 | 8 | # dependencies 9 | node_modules/ 10 | 11 | # IDEs and editors 12 | .idea/ 13 | .project 14 | .classpath 15 | .c9/ 16 | .launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | .sass-cache/ 29 | connect.lock/ 30 | coverage/ 31 | libpeerconnection.log/ 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | typings/ 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /angular-element/3rdpartylicenses.txt: -------------------------------------------------------------------------------- 1 | @angular-devkit/build-angular 2 | MIT 3 | The MIT License 4 | 5 | Copyright (c) 2017 Google, Inc. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | 25 | 26 | @angular/common 27 | MIT 28 | 29 | @angular/core 30 | MIT 31 | 32 | @angular/elements 33 | MIT 34 | 35 | @angular/platform-browser 36 | MIT 37 | 38 | core-js 39 | MIT 40 | Copyright (c) 2014-2019 Denis Pushkarev 41 | 42 | Permission is hereby granted, free of charge, to any person obtaining a copy 43 | of this software and associated documentation files (the "Software"), to deal 44 | in the Software without restriction, including without limitation the rights 45 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 46 | copies of the Software, and to permit persons to whom the Software is 47 | furnished to do so, subject to the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be included in 50 | all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 53 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 54 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 55 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 56 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 57 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 58 | THE SOFTWARE. 59 | 60 | 61 | css-loader 62 | MIT 63 | Copyright JS Foundation and other contributors 64 | 65 | Permission is hereby granted, free of charge, to any person obtaining 66 | a copy of this software and associated documentation files (the 67 | 'Software'), to deal in the Software without restriction, including 68 | without limitation the rights to use, copy, modify, merge, publish, 69 | distribute, sublicense, and/or sell copies of the Software, and to 70 | permit persons to whom the Software is furnished to do so, subject to 71 | the following conditions: 72 | 73 | The above copyright notice and this permission notice shall be 74 | included in all copies or substantial portions of the Software. 75 | 76 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 77 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 78 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 79 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 80 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 81 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 82 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 83 | 84 | 85 | regenerator-runtime 86 | MIT 87 | MIT License 88 | 89 | Copyright (c) 2014-present, Facebook, Inc. 90 | 91 | Permission is hereby granted, free of charge, to any person obtaining a copy 92 | of this software and associated documentation files (the "Software"), to deal 93 | in the Software without restriction, including without limitation the rights 94 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 95 | copies of the Software, and to permit persons to whom the Software is 96 | furnished to do so, subject to the following conditions: 97 | 98 | The above copyright notice and this permission notice shall be included in all 99 | copies or substantial portions of the Software. 100 | 101 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 102 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 103 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 104 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 105 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 106 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 107 | SOFTWARE. 108 | 109 | 110 | rxjs 111 | Apache-2.0 112 | Apache License 113 | Version 2.0, January 2004 114 | http://www.apache.org/licenses/ 115 | 116 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 117 | 118 | 1. Definitions. 119 | 120 | "License" shall mean the terms and conditions for use, reproduction, 121 | and distribution as defined by Sections 1 through 9 of this document. 122 | 123 | "Licensor" shall mean the copyright owner or entity authorized by 124 | the copyright owner that is granting the License. 125 | 126 | "Legal Entity" shall mean the union of the acting entity and all 127 | other entities that control, are controlled by, or are under common 128 | control with that entity. For the purposes of this definition, 129 | "control" means (i) the power, direct or indirect, to cause the 130 | direction or management of such entity, whether by contract or 131 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 132 | outstanding shares, or (iii) beneficial ownership of such entity. 133 | 134 | "You" (or "Your") shall mean an individual or Legal Entity 135 | exercising permissions granted by this License. 136 | 137 | "Source" form shall mean the preferred form for making modifications, 138 | including but not limited to software source code, documentation 139 | source, and configuration files. 140 | 141 | "Object" form shall mean any form resulting from mechanical 142 | transformation or translation of a Source form, including but 143 | not limited to compiled object code, generated documentation, 144 | and conversions to other media types. 145 | 146 | "Work" shall mean the work of authorship, whether in Source or 147 | Object form, made available under the License, as indicated by a 148 | copyright notice that is included in or attached to the work 149 | (an example is provided in the Appendix below). 150 | 151 | "Derivative Works" shall mean any work, whether in Source or Object 152 | form, that is based on (or derived from) the Work and for which the 153 | editorial revisions, annotations, elaborations, or other modifications 154 | represent, as a whole, an original work of authorship. For the purposes 155 | of this License, Derivative Works shall not include works that remain 156 | separable from, or merely link (or bind by name) to the interfaces of, 157 | the Work and Derivative Works thereof. 158 | 159 | "Contribution" shall mean any work of authorship, including 160 | the original version of the Work and any modifications or additions 161 | to that Work or Derivative Works thereof, that is intentionally 162 | submitted to Licensor for inclusion in the Work by the copyright owner 163 | or by an individual or Legal Entity authorized to submit on behalf of 164 | the copyright owner. For the purposes of this definition, "submitted" 165 | means any form of electronic, verbal, or written communication sent 166 | to the Licensor or its representatives, including but not limited to 167 | communication on electronic mailing lists, source code control systems, 168 | and issue tracking systems that are managed by, or on behalf of, the 169 | Licensor for the purpose of discussing and improving the Work, but 170 | excluding communication that is conspicuously marked or otherwise 171 | designated in writing by the copyright owner as "Not a Contribution." 172 | 173 | "Contributor" shall mean Licensor and any individual or Legal Entity 174 | on behalf of whom a Contribution has been received by Licensor and 175 | subsequently incorporated within the Work. 176 | 177 | 2. Grant of Copyright License. Subject to the terms and conditions of 178 | this License, each Contributor hereby grants to You a perpetual, 179 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 180 | copyright license to reproduce, prepare Derivative Works of, 181 | publicly display, publicly perform, sublicense, and distribute the 182 | Work and such Derivative Works in Source or Object form. 183 | 184 | 3. Grant of Patent License. Subject to the terms and conditions of 185 | this License, each Contributor hereby grants to You a perpetual, 186 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 187 | (except as stated in this section) patent license to make, have made, 188 | use, offer to sell, sell, import, and otherwise transfer the Work, 189 | where such license applies only to those patent claims licensable 190 | by such Contributor that are necessarily infringed by their 191 | Contribution(s) alone or by combination of their Contribution(s) 192 | with the Work to which such Contribution(s) was submitted. If You 193 | institute patent litigation against any entity (including a 194 | cross-claim or counterclaim in a lawsuit) alleging that the Work 195 | or a Contribution incorporated within the Work constitutes direct 196 | or contributory patent infringement, then any patent licenses 197 | granted to You under this License for that Work shall terminate 198 | as of the date such litigation is filed. 199 | 200 | 4. Redistribution. You may reproduce and distribute copies of the 201 | Work or Derivative Works thereof in any medium, with or without 202 | modifications, and in Source or Object form, provided that You 203 | meet the following conditions: 204 | 205 | (a) You must give any other recipients of the Work or 206 | Derivative Works a copy of this License; and 207 | 208 | (b) You must cause any modified files to carry prominent notices 209 | stating that You changed the files; and 210 | 211 | (c) You must retain, in the Source form of any Derivative Works 212 | that You distribute, all copyright, patent, trademark, and 213 | attribution notices from the Source form of the Work, 214 | excluding those notices that do not pertain to any part of 215 | the Derivative Works; and 216 | 217 | (d) If the Work includes a "NOTICE" text file as part of its 218 | distribution, then any Derivative Works that You distribute must 219 | include a readable copy of the attribution notices contained 220 | within such NOTICE file, excluding those notices that do not 221 | pertain to any part of the Derivative Works, in at least one 222 | of the following places: within a NOTICE text file distributed 223 | as part of the Derivative Works; within the Source form or 224 | documentation, if provided along with the Derivative Works; or, 225 | within a display generated by the Derivative Works, if and 226 | wherever such third-party notices normally appear. The contents 227 | of the NOTICE file are for informational purposes only and 228 | do not modify the License. You may add Your own attribution 229 | notices within Derivative Works that You distribute, alongside 230 | or as an addendum to the NOTICE text from the Work, provided 231 | that such additional attribution notices cannot be construed 232 | as modifying the License. 233 | 234 | You may add Your own copyright statement to Your modifications and 235 | may provide additional or different license terms and conditions 236 | for use, reproduction, or distribution of Your modifications, or 237 | for any such Derivative Works as a whole, provided Your use, 238 | reproduction, and distribution of the Work otherwise complies with 239 | the conditions stated in this License. 240 | 241 | 5. Submission of Contributions. Unless You explicitly state otherwise, 242 | any Contribution intentionally submitted for inclusion in the Work 243 | by You to the Licensor shall be under the terms and conditions of 244 | this License, without any additional terms or conditions. 245 | Notwithstanding the above, nothing herein shall supersede or modify 246 | the terms of any separate license agreement you may have executed 247 | with Licensor regarding such Contributions. 248 | 249 | 6. Trademarks. This License does not grant permission to use the trade 250 | names, trademarks, service marks, or product names of the Licensor, 251 | except as required for reasonable and customary use in describing the 252 | origin of the Work and reproducing the content of the NOTICE file. 253 | 254 | 7. Disclaimer of Warranty. Unless required by applicable law or 255 | agreed to in writing, Licensor provides the Work (and each 256 | Contributor provides its Contributions) on an "AS IS" BASIS, 257 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 258 | implied, including, without limitation, any warranties or conditions 259 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 260 | PARTICULAR PURPOSE. You are solely responsible for determining the 261 | appropriateness of using or redistributing the Work and assume any 262 | risks associated with Your exercise of permissions under this License. 263 | 264 | 8. Limitation of Liability. In no event and under no legal theory, 265 | whether in tort (including negligence), contract, or otherwise, 266 | unless required by applicable law (such as deliberate and grossly 267 | negligent acts) or agreed to in writing, shall any Contributor be 268 | liable to You for damages, including any direct, indirect, special, 269 | incidental, or consequential damages of any character arising as a 270 | result of this License or out of the use or inability to use the 271 | Work (including but not limited to damages for loss of goodwill, 272 | work stoppage, computer failure or malfunction, or any and all 273 | other commercial damages or losses), even if such Contributor 274 | has been advised of the possibility of such damages. 275 | 276 | 9. Accepting Warranty or Additional Liability. While redistributing 277 | the Work or Derivative Works thereof, You may choose to offer, 278 | and charge a fee for, acceptance of support, warranty, indemnity, 279 | or other liability obligations and/or rights consistent with this 280 | License. However, in accepting such obligations, You may act only 281 | on Your own behalf and on Your sole responsibility, not on behalf 282 | of any other Contributor, and only if You agree to indemnify, 283 | defend, and hold each Contributor harmless for any liability 284 | incurred by, or claims asserted against, such Contributor by reason 285 | of your accepting any such warranty or additional liability. 286 | 287 | END OF TERMS AND CONDITIONS 288 | 289 | APPENDIX: How to apply the Apache License to your work. 290 | 291 | To apply the Apache License to your work, attach the following 292 | boilerplate notice, with the fields enclosed by brackets "[]" 293 | replaced with your own identifying information. (Don't include 294 | the brackets!) The text should be enclosed in the appropriate 295 | comment syntax for the file format. We also recommend that a 296 | file or class name and description of purpose be included on the 297 | same "printed page" as the copyright notice for easier 298 | identification within third-party archives. 299 | 300 | Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors 301 | 302 | Licensed under the Apache License, Version 2.0 (the "License"); 303 | you may not use this file except in compliance with the License. 304 | You may obtain a copy of the License at 305 | 306 | http://www.apache.org/licenses/LICENSE-2.0 307 | 308 | Unless required by applicable law or agreed to in writing, software 309 | distributed under the License is distributed on an "AS IS" BASIS, 310 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 311 | See the License for the specific language governing permissions and 312 | limitations under the License. 313 | 314 | 315 | 316 | zone.js 317 | MIT 318 | The MIT License 319 | 320 | Copyright (c) 2010-2020 Google LLC. http://angular.io/license 321 | 322 | Permission is hereby granted, free of charge, to any person obtaining a copy 323 | of this software and associated documentation files (the "Software"), to deal 324 | in the Software without restriction, including without limitation the rights 325 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 326 | copies of the Software, and to permit persons to whom the Software is 327 | furnished to do so, subject to the following conditions: 328 | 329 | The above copyright notice and this permission notice shall be included in 330 | all copies or substantial portions of the Software. 331 | 332 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 333 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 334 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 335 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 336 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 337 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 338 | THE SOFTWARE. 339 | -------------------------------------------------------------------------------- /angular-element/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayusharora/angular-element-codelab/8343f7dec0ce3789fe19b991f8cd0ea03cd4831c/angular-element/assets/.gitkeep -------------------------------------------------------------------------------- /angular-element/assets/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "sliderArray":[ 3 | {"img": "http://bloquo.cc/img/works/1.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 4 | {"img": "http://bloquo.cc/img/works/2.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 5 | {"img": "http://bloquo.cc/img/works/3.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 6 | {"img": "http://bloquo.cc/img/works/4.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 7 | {"img": "http://bloquo.cc/img/works/5.jpg", "alt": "", "text": "365 Days Of weddings a year"} 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /angular-element/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayusharora/angular-element-codelab/8343f7dec0ce3789fe19b991f8cd0ea03cd4831c/angular-element/favicon.ico -------------------------------------------------------------------------------- /angular-element/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Motley Slider 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angular-element/polyfills-es2015.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"+rLv":function(t,e,n){var r=n("dyZX").document;t.exports=r&&r.documentElement},"0/R4":function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},"1TsA":function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},2:function(t,e,n){t.exports=n("hN/g")},"2OiF":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"3Lyj":function(t,e,n){var r=n("KroJ");t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},"45Tv":function(t,e,n){var r=n("N6cJ"),o=n("y3w9"),i=n("OP3Y"),s=r.has,a=r.get,c=r.key,u=function(t,e,n){if(s(t,e,n))return a(t,e,n);var r=i(e);return null!==r?u(t,r,n):void 0};r.exp({getMetadata:function(t,e){return u(t,o(e),arguments.length<3?void 0:c(arguments[2]))}})},"49D4":function(t,e,n){var r=n("N6cJ"),o=n("y3w9"),i=r.key,s=r.set;r.exp({defineMetadata:function(t,e,n,r){s(t,e,o(n),i(r))}})},"4LiD":function(t,e,n){"use strict";var r=n("dyZX"),o=n("XKFU"),i=n("KroJ"),s=n("3Lyj"),a=n("Z6vF"),c=n("SlkY"),u=n("9gX7"),l=n("0/R4"),f=n("eeVq"),p=n("XMVh"),h=n("fyDq"),d=n("Xbzi");t.exports=function(t,e,n,g,v,y){var _=r[t],k=_,m=v?"set":"add",b=k&&k.prototype,T={},w=function(t){var e=b[t];i(b,t,"delete"==t||"has"==t?function(t){return!(y&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!l(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof k&&(y||b.forEach&&!f((function(){(new k).entries().next()})))){var E=new k,x=E[m](y?{}:-0,1)!=E,S=f((function(){E.has(1)})),Z=p((function(t){new k(t)})),O=!y&&f((function(){for(var t=new k,e=5;e--;)t[m](e,e);return!t.has(-0)}));Z||((k=e((function(e,n){u(e,k,t);var r=d(new _,e,k);return null!=n&&c(n,v,r[m],r),r}))).prototype=b,b.constructor=k),(S||O)&&(w("delete"),w("has"),v&&w("get")),(O||x)&&w(m),y&&b.clear&&delete b.clear}else k=g.getConstructor(e,t,v,m),s(k.prototype,n),a.NEED=!0;return h(k,t),T[t]=k,o(o.G+o.W+o.F*(k!=_),T),y||g.setStrong(k,t,v),k}},"4R4u":function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"6FMO":function(t,e,n){var r=n("0/R4"),o=n("EWmC"),i=n("K0xU")("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),r(e)&&null===(e=e[i])&&(e=void 0)),void 0===e?Array:e}},"7Dlh":function(t,e,n){var r=n("N6cJ"),o=n("y3w9"),i=r.has,s=r.key;r.exp({hasOwnMetadata:function(t,e){return i(t,o(e),arguments.length<3?void 0:s(arguments[2]))}})},"9AAn":function(t,e,n){"use strict";var r=n("wmvG"),o=n("s5qY");t.exports=n("4LiD")("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(o(this,"Map"),t);return e&&e.v},set:function(t,e){return r.def(o(this,"Map"),0===t?0:t,e)}},r,!0)},"9gX7":function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},Afnz:function(t,e,n){"use strict";var r=n("LQAc"),o=n("XKFU"),i=n("KroJ"),s=n("Mukb"),a=n("hPIQ"),c=n("QaDb"),u=n("fyDq"),l=n("OP3Y"),f=n("K0xU")("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,d,g,v,y){c(n,e,d);var _,k,m,b=function(t){if(!p&&t in x)return x[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},T=e+" Iterator",w="values"==g,E=!1,x=t.prototype,S=x[f]||x["@@iterator"]||g&&x[g],Z=S||b(g),O=g?w?b("entries"):Z:void 0,P="Array"==e&&x.entries||S;if(P&&(m=l(P.call(new t)))!==Object.prototype&&m.next&&(u(m,T,!0),r||"function"==typeof m[f]||s(m,f,h)),w&&S&&"values"!==S.name&&(E=!0,Z=function(){return S.call(this)}),r&&!y||!p&&!E&&x[f]||s(x,f,Z),a[e]=Z,a[T]=h,g)if(_={values:w?Z:b("values"),keys:v?Z:b("keys"),entries:O},y)for(k in _)k in x||i(x,k,_[k]);else o(o.P+o.F*(p||E),e,_);return _}},BqfV:function(t,e,n){var r=n("N6cJ"),o=n("y3w9"),i=r.get,s=r.key;r.exp({getOwnMetadata:function(t,e){return i(t,o(e),arguments.length<3?void 0:s(arguments[2]))}})},CkkT:function(t,e,n){var r=n("m0Pp"),o=n("Ymqv"),i=n("S/j/"),s=n("ne8i"),a=n("zRwo");t.exports=function(t,e){var n=1==t,c=2==t,u=3==t,l=4==t,f=6==t,p=5==t||f,h=e||a;return function(e,a,d){for(var g,v,y=i(e),_=o(y),k=r(a,d,3),m=s(_.length),b=0,T=n?h(e,m):c?h(e,0):void 0;m>b;b++)if((p||b in _)&&(v=k(g=_[b],b,y),t))if(n)T[b]=v;else if(v)switch(t){case 3:return!0;case 5:return g;case 6:return b;case 2:T.push(g)}else if(l)return!1;return f?-1:u||l?l:T}}},DVgA:function(t,e,n){var r=n("zhAb"),o=n("4R4u");t.exports=Object.keys||function(t){return r(t,o)}},EK0E:function(t,e,n){"use strict";var r,o=n("CkkT")(0),i=n("KroJ"),s=n("Z6vF"),a=n("czNK"),c=n("ZD67"),u=n("0/R4"),l=n("eeVq"),f=n("s5qY"),p=s.getWeak,h=Object.isExtensible,d=c.ufstore,g={},v=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(t){if(u(t)){var e=p(t);return!0===e?d(f(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(f(this,"WeakMap"),t,e)}},_=t.exports=n("4LiD")("WeakMap",v,y,c,!0,!0);l((function(){return 7!=(new _).set((Object.freeze||Object)(g),7).get(g)}))&&(a((r=c.getConstructor(v,"WeakMap")).prototype,y),s.NEED=!0,o(["delete","has","get","set"],(function(t){var e=_.prototype,n=e[t];i(e,t,(function(e,o){if(u(e)&&!h(e)){this._f||(this._f=new r);var i=this._f[t](e,o);return"set"==t?this:i}return n.call(this,e,o)}))})))},EWmC:function(t,e,n){var r=n("LZWt");t.exports=Array.isArray||function(t){return"Array"==r(t)}},EemH:function(t,e,n){var r=n("UqcF"),o=n("RjD/"),i=n("aCFj"),s=n("apmT"),a=n("aagx"),c=n("xpql"),u=Object.getOwnPropertyDescriptor;e.f=n("nh4g")?u:function(t,e){if(t=i(t),e=s(e,!0),c)try{return u(t,e)}catch(n){}if(a(t,e))return o(!r.f.call(t,e),t[e])}},FJW5:function(t,e,n){var r=n("hswa"),o=n("y3w9"),i=n("DVgA");t.exports=n("nh4g")?Object.defineProperties:function(t,e){o(t);for(var n,s=i(e),a=s.length,c=0;a>c;)r.f(t,n=s[c++],e[n]);return t}},FZcq:function(t,e,n){n("49D4"),n("zq+C"),n("45Tv"),n("uAtd"),n("BqfV"),n("fN/3"),n("iW+S"),n("7Dlh"),n("Opxb"),t.exports=n("g3g5").Reflect},H6hf:function(t,e,n){var r=n("y3w9");t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(s){var i=t.return;throw void 0!==i&&r(i.call(t)),s}}},"I8a+":function(t,e,n){var r=n("LZWt"),o=n("K0xU")("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=Object(t),o))?n:i?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},Iw71:function(t,e,n){var r=n("0/R4"),o=n("dyZX").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"J+6e":function(t,e,n){var r=n("I8a+"),o=n("K0xU")("iterator"),i=n("hPIQ");t.exports=n("g3g5").getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},JiEa:function(t,e){e.f=Object.getOwnPropertySymbols},K0xU:function(t,e,n){var r=n("VTer")("wks"),o=n("ylqs"),i=n("dyZX").Symbol,s="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=s&&i[t]||(s?i:o)("Symbol."+t))}).store=r},KroJ:function(t,e,n){var r=n("dyZX"),o=n("Mukb"),i=n("aagx"),s=n("ylqs")("src"),a=Function.toString,c=(""+a).split("toString");n("g3g5").inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(u&&(i(n,s)||o(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[s]||a.call(this)}))},Kuth:function(t,e,n){var r=n("y3w9"),o=n("FJW5"),i=n("4R4u"),s=n("YTvA")("IE_PROTO"),a=function(){},c=function(){var t,e=n("Iw71")("iframe"),r=i.length;for(e.style.display="none",n("+rLv").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write(" 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /image-slider-finished/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-app", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build --prod --output-hashing=none", 8 | "package": "cat dist/my-app/{runtime-es5,polyfills-es5,scripts,main-es5}.js | gzip > elements.js.gz", 9 | "serve": "http-server", 10 | "test": "ng test", 11 | "lint": "ng lint", 12 | "e2e": "ng e2e" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/animations": "^10.1.6", 17 | "@angular/common": "^10.1.6", 18 | "@angular/compiler": "^10.1.6", 19 | "@angular/core": "^10.1.6", 20 | "@angular/elements": "^10.1.6", 21 | "@angular/forms": "^10.1.6", 22 | "@angular/http": "^6.0.2", 23 | "@angular/platform-browser": "^10.1.6", 24 | "@angular/platform-browser-dynamic": "^10.1.6", 25 | "@angular/router": "^10.1.6", 26 | "angular": "^1.7.7", 27 | "core-js": "^2.5.4", 28 | "rxjs": "6.6.3", 29 | "zone.js": "^0.10.3", 30 | "document-register-element": "^1.7.2" 31 | }, 32 | "devDependencies": { 33 | "@angular-devkit/build-angular": "~0.1001.7", 34 | "@angular/cli": "~10.1.7", 35 | "@angular/compiler-cli": "^10.1.6", 36 | "@angular/language-service": "^10.1.6", 37 | "@types/jasmine": "~2.8.6", 38 | "@types/jasminewd2": "~2.0.3", 39 | "@types/node": "~8.9.4", 40 | "codelyzer": "~6.0.1", 41 | "jasmine-core": "~2.99.1", 42 | "jasmine-spec-reporter": "~4.2.1", 43 | "karma": "~1.7.1", 44 | "karma-chrome-launcher": "~2.2.0", 45 | "karma-coverage-istanbul-reporter": "~1.4.2", 46 | "karma-jasmine": "~1.1.1", 47 | "karma-jasmine-html-reporter": "^0.2.2", 48 | "protractor": "^5.4.2", 49 | "ts-node": "~5.0.1", 50 | "tslint": "~5.9.1", 51 | "typescript": "~4.0.3" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule, Injector } from '@angular/core'; 3 | import { createCustomElement } from '@angular/elements'; 4 | import { SliderComponent } from './slider/slider.component'; 5 | import { HttpClientModule } from '@angular/common/http'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | SliderComponent 10 | ], 11 | imports: [ 12 | BrowserModule, 13 | HttpClientModule 14 | ], 15 | entryComponents: [SliderComponent], 16 | }) 17 | export class AppModule { 18 | constructor(private injector: Injector) { 19 | const slider = createCustomElement(SliderComponent, { injector }); 20 | customElements.define('motley-slider', slider); 21 | } 22 | 23 | ngDoBootstrap() {} 24 | 25 | } 26 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/data.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { DataService } from './data.service'; 4 | 5 | describe('DataService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [DataService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([DataService], (service: DataService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/data.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import {HttpClient} from '@angular/common/http'; 3 | 4 | const URL = '../assets/data.json'; 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class DataService { 9 | 10 | constructor(private http: HttpClient) { 11 | } 12 | 13 | getData() { 14 | return this.http.get(URL); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/slider/result.ts: -------------------------------------------------------------------------------- 1 | export interface Result { 2 | sliderArray: [ 3 | {'img': string, 'alt': string, 'text': string } 4 | ]; 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/slider/slider.component.css: -------------------------------------------------------------------------------- 1 | 2 | img { 3 | max-width: 100%; 4 | } 5 | 6 | .container { 7 | height:100%; 8 | overflow: hidden; 9 | } 10 | 11 | .img-container { 12 | position: absolute; 13 | left: 0; 14 | opacity: 0; 15 | height: auto !important; 16 | background-size: cover; 17 | background-position: center; 18 | will-change: opacity; 19 | transition: opacity .3s; 20 | cursor: pointer; 21 | } 22 | 23 | 24 | 25 | .slide-button:hover, .slide-button-select { 26 | width: 64px !important; 27 | background-color: rgba(255,255,255,1) !important; 28 | pointer-events: none; 29 | transition: background-color .4s, width 4s cubic-bezier(0.190, 1.000, 0.220, 1.000) !important; 30 | } 31 | 32 | 33 | .slide-button { 34 | width: 30px; 35 | height: 4px; 36 | background-color: rgba(255,255,255,.5); 37 | cursor: pointer; 38 | position: absolute; 39 | 40 | } 41 | 42 | .slider { 43 | position: absolute; 44 | top: 50%; 45 | right: 80px; 46 | opacity: 1; 47 | min-width: 30px; 48 | 49 | } 50 | 51 | .slide-button-parent-container { 52 | position: relative; 53 | margin: 22px 0; 54 | min-height: 4px; 55 | } 56 | 57 | .select-box { 58 | min-height: 10px; 59 | } 60 | 61 | .text-container { 62 | 63 | height: 100vh; 64 | justify-content: center; 65 | display: flex; 66 | align-items: center; 67 | flex-direction: column; 68 | } 69 | 70 | .page-text { 71 | min-height: 373px; 72 | width: 50%; 73 | height: 100%; 74 | opacity: 0; 75 | font-weight: 300; 76 | font-size: 90px; 77 | color: white; 78 | } 79 | 80 | .selected { 81 | opacity: 1; 82 | transition: 1s; 83 | } 84 | 85 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/slider/slider.component.html: -------------------------------------------------------------------------------- 1 |
2 |
4 | {{i.alt}} 5 |
6 | 7 | 8 |
9 |
10 |
11 |

{{i.text}}

12 |
13 |
14 |
15 | 16 |
17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/slider/slider.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { SliderComponent } from './slider.component'; 3 | 4 | describe('SliderComponent', () => { 5 | let component: SliderComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | 10 | TestBed.configureTestingModule({ 11 | declarations: [ SliderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SliderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /image-slider-finished/src/app/slider/slider.component.ts: -------------------------------------------------------------------------------- 1 | import { DataService } from './../data.service'; 2 | import { Component, OnInit, ViewEncapsulation} from '@angular/core'; 3 | import {Result} from './result'; 4 | @Component({ 5 | selector: 'app-slider', 6 | templateUrl: './slider.component.html', 7 | styleUrls: ['./slider.component.css'], 8 | encapsulation: ViewEncapsulation.ShadowDom 9 | }) 10 | export class SliderComponent implements OnInit { 11 | sliderArray: object[]; 12 | transform: number; 13 | selectedIndex = 0; 14 | constructor(private data: DataService) { 15 | this.sliderArray = []; 16 | this.selectedIndex = 0; 17 | this.transform = 100; 18 | } 19 | 20 | ngOnInit() { 21 | this.data.getData().subscribe((result: Result) => { 22 | this.sliderArray = result.sliderArray; 23 | }); 24 | } 25 | 26 | selected(x) { 27 | this.downSelected(x); 28 | this.selectedIndex = x; 29 | } 30 | 31 | keySelected(x) { 32 | this.downSelected(x); 33 | this.selectedIndex = x; 34 | } 35 | 36 | downSelected(i) { 37 | this.transform = 100 - (i) * 50; 38 | this.selectedIndex = this.selectedIndex + 1; 39 | if (this.selectedIndex > 4) { 40 | this.selectedIndex = 0; 41 | } 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /image-slider-finished/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayusharora/angular-element-codelab/8343f7dec0ce3789fe19b991f8cd0ea03cd4831c/image-slider-finished/src/assets/.gitkeep -------------------------------------------------------------------------------- /image-slider-finished/src/assets/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "sliderArray":[ 3 | {"img": "http://bloquo.cc/img/works/1.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 4 | {"img": "http://bloquo.cc/img/works/2.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 5 | {"img": "http://bloquo.cc/img/works/3.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 6 | {"img": "http://bloquo.cc/img/works/4.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 7 | {"img": "http://bloquo.cc/img/works/5.jpg", "alt": "", "text": "365 Days Of weddings a year"} 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /image-slider-finished/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /image-slider-finished/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /image-slider-finished/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /image-slider-finished/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayusharora/angular-element-codelab/8343f7dec0ce3789fe19b991f8cd0ea03cd4831c/image-slider-finished/src/favicon.ico -------------------------------------------------------------------------------- /image-slider-finished/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MyApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /image-slider-finished/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /image-slider-finished/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /image-slider-finished/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /image-slider-finished/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /image-slider-finished/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /image-slider-finished/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /image-slider-finished/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /image-slider-finished/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /image-slider-finished/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2015", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /image-slider-finished/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /image-slider/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /image-slider/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /image-slider/README.md: -------------------------------------------------------------------------------- 1 | # MyApp 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.3. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /image-slider/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "my-app": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/my-app", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | "src/styles.css" 27 | ], 28 | "scripts": [] 29 | }, 30 | "configurations": { 31 | "production": { 32 | "fileReplacements": [ 33 | { 34 | "replace": "src/environments/environment.ts", 35 | "with": "src/environments/environment.prod.ts" 36 | } 37 | ], 38 | "optimization": true, 39 | "outputHashing": "all", 40 | "sourceMap": false, 41 | "extractCss": true, 42 | "namedChunks": false, 43 | "aot": true, 44 | "extractLicenses": true, 45 | "vendorChunk": false, 46 | "buildOptimizer": true 47 | } 48 | } 49 | }, 50 | "serve": { 51 | "builder": "@angular-devkit/build-angular:dev-server", 52 | "options": { 53 | "browserTarget": "my-app:build" 54 | }, 55 | "configurations": { 56 | "production": { 57 | "browserTarget": "my-app:build:production" 58 | } 59 | } 60 | }, 61 | "extract-i18n": { 62 | "builder": "@angular-devkit/build-angular:extract-i18n", 63 | "options": { 64 | "browserTarget": "my-app:build" 65 | } 66 | }, 67 | "test": { 68 | "builder": "@angular-devkit/build-angular:karma", 69 | "options": { 70 | "main": "src/test.ts", 71 | "polyfills": "src/polyfills.ts", 72 | "tsConfig": "src/tsconfig.spec.json", 73 | "karmaConfig": "src/karma.conf.js", 74 | "styles": [ 75 | "src/styles.css" 76 | ], 77 | "scripts": [], 78 | "assets": [ 79 | "src/favicon.ico", 80 | "src/assets" 81 | ] 82 | } 83 | }, 84 | "lint": { 85 | "builder": "@angular-devkit/build-angular:tslint", 86 | "options": { 87 | "tsConfig": [ 88 | "src/tsconfig.app.json", 89 | "src/tsconfig.spec.json" 90 | ], 91 | "exclude": [ 92 | "**/node_modules/**" 93 | ] 94 | } 95 | } 96 | } 97 | }, 98 | "my-app-e2e": { 99 | "root": "e2e/", 100 | "projectType": "application", 101 | "architect": { 102 | "e2e": { 103 | "builder": "@angular-devkit/build-angular:protractor", 104 | "options": { 105 | "protractorConfig": "e2e/protractor.conf.js", 106 | "devServerTarget": "my-app:serve" 107 | } 108 | }, 109 | "lint": { 110 | "builder": "@angular-devkit/build-angular:tslint", 111 | "options": { 112 | "tsConfig": "e2e/tsconfig.e2e.json", 113 | "exclude": [ 114 | "**/node_modules/**" 115 | ] 116 | } 117 | } 118 | } 119 | } 120 | }, 121 | "defaultProject": "my-app", 122 | "cli": { 123 | "analytics": "8e1cf773-b1a2-46cc-9dff-7c7e9faaaca0" 124 | } 125 | 126 | } -------------------------------------------------------------------------------- /image-slider/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /image-slider/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /image-slider/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /image-slider/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /image-slider/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-app", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build --prod --output-hashing=none", 8 | "package": "cat dist/my-app/{runtime-es5,polyfills-es5,scripts,main-es5}.js | gzip > elements.js.gz", 9 | "serve": "http-server", 10 | "test": "ng test", 11 | "lint": "ng lint", 12 | "e2e": "ng e2e" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/animations": "^10.1.6", 17 | "@angular/common": "^10.1.6", 18 | "@angular/compiler": "^10.1.6", 19 | "@angular/core": "^10.1.6", 20 | "@angular/elements": "^10.1.6", 21 | "@angular/forms": "^10.1.6", 22 | "@angular/http": "^6.0.2", 23 | "@angular/platform-browser": "^10.1.6", 24 | "@angular/platform-browser-dynamic": "^10.1.6", 25 | "@angular/router": "^10.1.6", 26 | "angular": "^1.7.7", 27 | "core-js": "^2.5.4", 28 | "rxjs": "6.6.3", 29 | "zone.js": "^0.10.3", 30 | "document-register-element": "^1.7.2" 31 | }, 32 | "devDependencies": { 33 | "@angular-devkit/build-angular": "~0.1001.7", 34 | "@angular/cli": "~10.1.7", 35 | "@angular/compiler-cli": "^10.1.6", 36 | "@angular/language-service": "^10.1.6", 37 | "@types/jasmine": "~2.8.6", 38 | "@types/jasminewd2": "~2.0.3", 39 | "@types/node": "~8.9.4", 40 | "codelyzer": "~6.0.1", 41 | "jasmine-core": "~2.99.1", 42 | "jasmine-spec-reporter": "~4.2.1", 43 | "karma": "~1.7.1", 44 | "karma-chrome-launcher": "~2.2.0", 45 | "karma-coverage-istanbul-reporter": "~1.4.2", 46 | "karma-jasmine": "~1.1.1", 47 | "karma-jasmine-html-reporter": "^0.2.2", 48 | "protractor": "^5.4.2", 49 | "ts-node": "~5.0.1", 50 | "tslint": "~5.9.1", 51 | "typescript": "~4.0.3" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /image-slider/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { SliderComponent } from './slider/slider.component'; 4 | import { HttpClientModule } from '@angular/common/http'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | SliderComponent 9 | ], 10 | imports: [ 11 | BrowserModule, 12 | HttpClientModule 13 | ], 14 | providers: [], 15 | bootstrap: [] 16 | }) 17 | export class AppModule { } 18 | 19 | -------------------------------------------------------------------------------- /image-slider/src/app/data.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import {HttpClient} from '@angular/common/http'; 3 | 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class DataService { 9 | 10 | constructor(private http: HttpClient) { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /image-slider/src/app/slider/result.ts: -------------------------------------------------------------------------------- 1 | export interface Result { 2 | sliderArray: [ 3 | {'img': string, 'alt': string, 'text': string } 4 | ]; 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /image-slider/src/app/slider/slider.component.css: -------------------------------------------------------------------------------- 1 | 2 | img { 3 | max-width: 100%; 4 | } 5 | 6 | .container { 7 | height:100%; 8 | overflow: hidden; 9 | } 10 | 11 | .img-container { 12 | position: absolute; 13 | left: 0; 14 | opacity: 0; 15 | height: auto !important; 16 | background-size: cover; 17 | background-position: center; 18 | will-change: opacity; 19 | transition: opacity .3s; 20 | cursor: pointer; 21 | } 22 | 23 | 24 | 25 | .slide-button:hover, .slide-button-select { 26 | width: 64px !important; 27 | background-color: rgba(255,255,255,1) !important; 28 | pointer-events: none; 29 | transition: background-color .4s, width 4s cubic-bezier(0.190, 1.000, 0.220, 1.000) !important; 30 | } 31 | 32 | 33 | .slide-button { 34 | width: 30px; 35 | height: 4px; 36 | background-color: rgba(255,255,255,.5); 37 | cursor: pointer; 38 | position: absolute; 39 | 40 | } 41 | 42 | .slider { 43 | position: absolute; 44 | top: 50%; 45 | right: 80px; 46 | opacity: 1; 47 | min-width: 30px; 48 | 49 | } 50 | 51 | .slide-button-parent-container { 52 | position: relative; 53 | margin: 22px 0; 54 | min-height: 4px; 55 | } 56 | 57 | .select-box { 58 | min-height: 10px; 59 | } 60 | 61 | .text-container { 62 | 63 | height: 100vh; 64 | justify-content: center; 65 | display: flex; 66 | align-items: center; 67 | flex-direction: column; 68 | } 69 | 70 | .page-text { 71 | min-height: 373px; 72 | width: 50%; 73 | height: 100%; 74 | opacity: 0; 75 | font-weight: 300; 76 | font-size: 90px; 77 | color: white; 78 | } 79 | 80 | .selected { 81 | opacity: 1; 82 | transition: 1s; 83 | } 84 | 85 | -------------------------------------------------------------------------------- /image-slider/src/app/slider/slider.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /image-slider/src/app/slider/slider.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SliderComponent } from './slider.component'; 4 | 5 | describe('SliderComponent', () => { 6 | let component: SliderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SliderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SliderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /image-slider/src/app/slider/slider.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-slider', 5 | templateUrl: './slider.component.html', 6 | styleUrls: ['./slider.component.css'] 7 | }) 8 | export class SliderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /image-slider/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayusharora/angular-element-codelab/8343f7dec0ce3789fe19b991f8cd0ea03cd4831c/image-slider/src/assets/.gitkeep -------------------------------------------------------------------------------- /image-slider/src/assets/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "sliderArray":[ 3 | {"img": "http://bloquo.cc/img/works/1.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 4 | {"img": "http://bloquo.cc/img/works/2.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 5 | {"img": "http://bloquo.cc/img/works/3.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 6 | {"img": "http://bloquo.cc/img/works/4.jpg", "alt": "", "text": "365 Days Of weddings a year"}, 7 | {"img": "http://bloquo.cc/img/works/5.jpg", "alt": "", "text": "365 Days Of weddings a year"} 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /image-slider/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /image-slider/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /image-slider/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /image-slider/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayusharora/angular-element-codelab/8343f7dec0ce3789fe19b991f8cd0ea03cd4831c/image-slider/src/favicon.ico -------------------------------------------------------------------------------- /image-slider/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MyApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /image-slider/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /image-slider/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /image-slider/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /image-slider/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /image-slider/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /image-slider/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /image-slider/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /image-slider/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /image-slider/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2015", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /image-slider/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1 3 | } 4 | --------------------------------------------------------------------------------