{"id":999,"date":"2016-09-12T10:24:31","date_gmt":"2016-09-12T08:24:31","guid":{"rendered":"http:\/\/blog.thecodecampus.de\/?p=999"},"modified":"2025-07-03T09:39:50","modified_gmt":"2025-07-03T07:39:50","slug":"angular-2-animate-creating-sliding-side-navigation","status":"publish","type":"post","link":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/","title":{"rendered":"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial"},"content":{"rendered":"<p><a href=\"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/gif.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1017\" style=\"max-width: 100%; display: block; height: auto;\" src=\"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/gif.gif\" alt=\"Example\" width=\"800\" height=\"500\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1>#1 Project Setup<\/h1>\n<p>Animations in Angular 2 are probably easier than you think. In this tutorial we will create a simple side navigation that will leave and enter the screen from the right side. We will use Angular-CLI and TypeScript but you should also be able to adopt the steps to any other project like Ionic 2.<br \/>\n<!--more--><\/p>\n<p>First of all install the latest version of the Angular-CLI. Currently the project is under heavy development. Please make sure to get at least\u00a0version 1.0.0-beta.11-webpack.8\u00a0or higher. To print out your current version use <code>ng --version<\/code>.<\/p>\n<p><a href=\"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/cli-version.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1000\" src=\"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/cli-version.png\" alt=\"cli-version\" width=\"625\" height=\"159\" srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/cli-version.png 625w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/cli-version-300x76.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>If your version is older, remove it, clear the npm cache and reinstall with the following commands:<\/p>\n<pre class=\"lang:default decode:true\" title=\"install latest version of Angular CLI\">npm uninstall -g angular-cli\r\nnpm cache clean\r\nnpm install -g angular-cli@1.0.0-beta.11-webpack.8\r\n\r\n<\/pre>\n<p><strong style=\"line-height: 1.5;\">Right now it is required to give the full version in the npm install command, otherwise you will get an old version!\u00a0<\/strong><span style=\"line-height: 1.5;\">You can check for the latest version number <\/span><a style=\"line-height: 1.5;\" href=\"https:\/\/github.com\/angular\/angular-cli\/blob\/master\/package.json\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a><span style=\"line-height: 1.5;\">.<\/span><\/p>\n<p><a style=\"display: inline-block;\" href=\"https:\/\/www.thecodecampus.de\/schulungen\/angular\">\n<picture><source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/weiter-entwickeln_anne_WP_big.png\" media=\"(min-width: 1024px)\" \/><\/picture> <picture><source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/weiter-entwickeln_anne_WP_medium.png\" media=\"(min-width: 600px)\" \/><\/picture> <picture><img decoding=\"async\" class=\"alignnone size-full wp-image-38\" src=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/weiter-entwickeln_anne_WP_small.png\" alt=\"Angular Schulungen\" \/><\/picture> <\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>#2\u00a0Required Markup<\/h1>\n<p>Since our toolchain is now set up, lets kick of a fresh project with Angular-CLI\u00a0and\u00a0add the required markup for our example.<\/p>\n<pre class=\"lang:default decode:true\" title=\"create and start a new Project\">ng new angular-2-animate-tutorial\r\ncd\u00a0angular-2-animate-tutorial\r\nng serve\r\n<\/pre>\n<p>Your app is now running at localhost:4200.<\/p>\n<p>httOpen a new console window and create the menu component:<\/p>\n<pre class=\"lang:default decode:true \">ng generate component menu\r\n<\/pre>\n<p>Now include the generated menu to your app:<\/p>\n<pre class=\"lang:default decode:true\" title=\"src\/app\/app.component.html\">&lt;h1&gt;\r\n  {{title}}\r\n&lt;\/h1&gt;\r\n\r\n&lt;app-menu&gt;&lt;\/app-menu&gt;\r\n<\/pre>\n<p>Add some menu points to the menu:<\/p>\n<pre class=\"lang:default decode:true\" title=\"src\/app\/menu\/menu.component.html\">&lt;ul&gt;\r\n  &lt;li&gt;Menu Item&lt;\/li&gt;\r\n  &lt;li&gt;Menu Item&lt;\/li&gt;\r\n  &lt;li&gt;Menu Item&lt;\/li&gt;\r\n  &lt;li&gt;Menu Item&lt;\/li&gt;\r\n  &lt;li&gt;Menu Item&lt;\/li&gt;\r\n  &lt;li&gt;Menu Item&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n<\/pre>\n<p>And some styles:<\/p>\n<pre class=\"lang:default decode:true\" title=\"src\/app\/menu\/menu.component.css\">:host {\r\n  background: #1a2580;\r\n  color: #fff;\r\n  position: fixed;\r\n  left: auto;\r\n  top: 0;\r\n  right: 0;\r\n  bottom: 0;\r\n  width: 20%;\r\n  min-width: 250px;\r\n  z-index: 9999;\r\n  font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;\r\n}\r\n\r\nul {\r\n  font-size: 18px;\r\n  line-height: 3;\r\n  font-weight: 400;\r\n  padding-top: 50px;\r\n  list-style: none;\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Your output should now look like mine:<\/p>\n<p><a href=\"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/added-sidebar.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1003\" src=\"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/added-sidebar.png\" alt=\"added-sidebar\" width=\"721\" height=\"836\" srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/added-sidebar.png 721w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/added-sidebar-259x300.png 259w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/a><\/p>\n<p>Now we need a toggle button:<\/p>\n<pre class=\"lang:default decode:true\" title=\"src\/app\/menu\/app.component.ts\">&lt;button (click)=\"toggleMenu()\" class=\"hamburger\"&gt;\r\n  &lt;span&gt;toggle menu&lt;\/span&gt;\r\n&lt;\/button&gt;\r\n\r\n&lt;h1&gt;\r\n  {{title}}\r\n&lt;\/h1&gt;\r\n\r\n&lt;app-menu&gt;&lt;\/app-menu&gt;\r\n<\/pre>\n<pre class=\"lang:css decode:true\" title=\"src\/app\/app.component.css\">.hamburger {\r\n  display: block;\r\n  position: relative;\r\n  overflow: hidden;\r\n  margin: 0;\r\n  padding: 0;\r\n  width: 96px;\r\n  height: 96px;\r\n  font-size: 0;\r\n  text-indent: -9999px;\r\n  cursor: pointer;\r\n  outline: none;\r\n  background: none;\r\n  border: 0;\r\n}\r\n\r\n\r\n.hamburger span {\r\n  display: block;\r\n  position: absolute;\r\n  top: 44px;\r\n  left: 18px;\r\n  right: 18px;\r\n  height: 8px;\r\n  background: #1a2580;\r\n}\r\n\r\n.hamburger span::before,\r\n.hamburger span::after {\r\n  display: block;\r\n  position: absolute;\r\n  left: 0;\r\n  width: 100%;\r\n  height: 8px;\r\n  background-color: #1a2580;\r\n  content: \"\";\r\n}\r\n\r\n.hamburger span::before {\r\n  top: -20px;\r\n}\r\n\r\n.hamburger span::after {\r\n  bottom: -20px;\r\n}\r\n<\/pre>\n<p>Result:<\/p>\n<p><a href=\"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/add-hamburger.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1005\" src=\"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/add-hamburger.png\" alt=\"add-hamburger\" width=\"960\" height=\"483\" srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/add-hamburger.png 960w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/add-hamburger-300x151.png 300w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/add-hamburger-768x386.png 768w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1>#3 Animations<\/h1>\n<p>This completes our dummy markup. Now it is time to get started with the actual animation. First of all we need to declare some imports in the component responsible for the animation. This will be our app.component. And create\u00a0the <code>toggleMenu<\/code> method.<\/p>\n<pre class=\"lang:default decode:true\" title=\"src\/app\/app.component.ts\">import {Component, trigger, state, style, transition, animate} from '@angular\/animations';\r\n\r\n@Component({\r\n  selector: 'app-root',\r\n  templateUrl: '.\/app.component.html',\r\n  styleUrls: ['.\/app.component.css']\r\n})\r\nexport class AppComponent {\r\n  title = 'app works!';\r\n  \r\n  toggleMenu() {\r\n    \r\n  }\r\n}\r\n<\/pre>\n<p>Since our side navigation is located on the right side of the screen we want it be hidden by default and then slide in from the right side on toggle. There is no need to use *NgIf or something else. We simply move the navigation off the canvas to the right side by using <code>transform:translate<\/code>. On toggle the navigation will slide back in by resetting the transform to zero.<br \/>\nThe animation is declared in the component decorator in app.component.ts and then applied to the planned HTML\u00a0element using the [@] syntax.<\/p>\n<p>Add the animation definition:<\/p>\n<pre class=\"lang:default decode:true\" title=\"src\/app\/app.component.ts\">import {Component, trigger, state, style, transition, animate} from '@angular\/animations';\r\n\r\n@Component({\r\n  selector: 'app-root',\r\n  templateUrl: '.\/app.component.html',\r\n  styleUrls: ['.\/app.component.css'],\r\n  animations: [\r\n    trigger('slideInOut', [\r\n      state('in', style({\r\n        transform: 'translate3d(0, 0, 0)'\r\n      })),\r\n      state('out', style({\r\n        transform: 'translate3d(100%, 0, 0)'\r\n      })),\r\n      transition('in =&gt; out', animate('400ms ease-in-out')),\r\n      transition('out =&gt; in', animate('400ms ease-in-out'))\r\n    ]),\r\n  ]\r\n})\r\nexport class AppComponent {\r\n  title = 'app works!';\r\n\r\n  toggleMenu() {\r\n\r\n  }\r\n}\r\n<\/pre>\n<p>Now we need a variable that holds the current state of the animation (&#8218;in&#8216; or &#8218;out&#8216;). This will be later toggled. The initial state should be &#8218;out&#8216; in order to hide the navigation by default. Also we are adding now the logic of the toggleMenu method, it will simply toggle the states value.<\/p>\n<pre class=\"lang:default decode:true \" title=\"src\/app\/app.component.ts\">import {Component, trigger, state, style, transition, animate} from '@angular\/animations';\r\n\r\n@Component({\r\n  selector: 'app-root',\r\n  templateUrl: '.\/app.component.html',\r\n  styleUrls: ['.\/app.component.css'],\r\n  animations: [\r\n    trigger('slideInOut', [\r\n      state('in', style({\r\n        transform: 'translate3d(0, 0, 0)'\r\n      })),\r\n      state('out', style({\r\n        transform: 'translate3d(100%, 0, 0)'\r\n      })),\r\n      transition('in =&gt; out', animate('400ms ease-in-out')),\r\n      transition('out =&gt; in', animate('400ms ease-in-out'))\r\n    ]),\r\n  ]\r\n})\r\nexport class AppComponent {\r\n  title = 'app works!';\r\n\r\n  menuState:string = 'out';\r\n\r\n  toggleMenu() {\r\n    \/\/ 1-line if statement that toggles the value:\r\n    this.menuState = this.menuState === 'out' ? 'in' : 'out';\r\n  }\r\n}\r\n<\/pre>\n<p>That&#8217;s pretty much it. Last step is to add the animation to the component call in our HTML markup using the already mentioned @ syntax. The first part matches the animations name and the given parameter is the value (&#8218;out&#8216; or &#8218;in&#8216;) from our component.<\/p>\n<pre class=\"lang:default decode:true \">&lt;app-menu [@slideInOut]=\"menuState\"&gt;&lt;\/app-menu&gt;\r\n<\/pre>\n<p>Before you ship this to production make sure to have the webanimations polyfill included, e.g. by adding this to your index.html:<\/p>\n<pre class=\"lang:default decode:true\" title=\"src\/index.html\">&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/web-animations\/2.2.2\/web-animations.min.js\"&gt;&lt;\/script&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1>#4 Final Result:<\/h1>\n<div style=\"position: relative; padding-bottom: 56.25%; padding-top: 35px; height: 0; overflow: hidden;\">\n<p><iframe loading=\"lazy\" width=\"300\" height=\"150\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" src=\"https:\/\/cankattwinkel.github.io\/angular-2-animation-tutorial\/\">&nbsp;<\/p>\n<p><\/iframe><\/p>\n<\/div>\n<h2>You can find the full\u00a0code\u00a0here:<\/h2>\n<p><a href=\"https:\/\/github.com\/CanKattwinkel\/angular-2-animation-tutorial\" target=\"_blank\" rel=\"noopener noreferrer\">Full Code at Github<\/a><br \/>\n<a href=\"https:\/\/cankattwinkel.github.io\/angular-2-animation-tutorial\/\" target=\"_blank\" rel=\"noopener noreferrer\">Example Demo<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; #1 Project Setup Animations in Angular 2 are probably easier than you think. In this tutorial we will create a simple side navigation that will leave and enter the screen from the right side. We will use Angular-CLI and TypeScript but you should also be able to adopt the steps to any other [&#8230;]<br \/><a class=\"meta-big\" href=\"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/\"> READ MORE<\/a><\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,60],"tags":[],"class_list":["post-999","post","type-post","status-publish","format-standard","hentry","category-angular","category-typescript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial - Web Development Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial - Web Development Blog\" \/>\n<meta property=\"og:description\" content=\"&nbsp; &nbsp; #1 Project Setup Animations in Angular 2 are probably easier than you think. In this tutorial we will create a simple side navigation that will leave and enter the screen from the right side. We will use Angular-CLI and TypeScript but you should also be able to adopt the steps to any other [...] READ MORE\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Development tips and tricks - theCodeCampus Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-12T08:24:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-03T07:39:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/gif.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"theCodeCampus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"theCodeCampus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/\"},\"author\":{\"name\":\"theCodeCampus\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/276bbda2f8da73154f22fb652201cfbc\"},\"headline\":\"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial\",\"datePublished\":\"2016-09-12T08:24:31+00:00\",\"dateModified\":\"2025-07-03T07:39:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/\"},\"wordCount\":507,\"commentCount\":37,\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/gif.gif\",\"articleSection\":[\"Angular\",\"TypeScript\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/\",\"name\":\"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial - Web Development Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/gif.gif\",\"datePublished\":\"2016-09-12T08:24:31+00:00\",\"dateModified\":\"2025-07-03T07:39:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#primaryimage\",\"url\":\"http:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/gif.gif\",\"contentUrl\":\"http:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/gif.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-2-animate-creating-sliding-side-navigation\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"name\":\"Web Development tips and tricks - theCodeCampus Blog\",\"description\":\"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\",\"name\":\"theCodeCampus\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"width\":156,\"height\":156,\"caption\":\"theCodeCampus\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/276bbda2f8da73154f22fb652201cfbc\",\"name\":\"theCodeCampus\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"caption\":\"theCodeCampus\"},\"description\":\"Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/showcase\\\/thecodecampus\\\/\"],\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial - Web Development Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/","og_locale":"de_DE","og_type":"article","og_title":"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial - Web Development Blog","og_description":"&nbsp; &nbsp; #1 Project Setup Animations in Angular 2 are probably easier than you think. In this tutorial we will create a simple side navigation that will leave and enter the screen from the right side. We will use Angular-CLI and TypeScript but you should also be able to adopt the steps to any other [...] READ MORE","og_url":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/","og_site_name":"Web Development tips and tricks - theCodeCampus Blog","article_published_time":"2016-09-12T08:24:31+00:00","article_modified_time":"2025-07-03T07:39:50+00:00","og_image":[{"width":800,"height":500,"url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2016\/09\/gif.gif","type":"image\/gif"}],"author":"theCodeCampus","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"theCodeCampus","Gesch\u00e4tzte Lesezeit":"4\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#article","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/"},"author":{"name":"theCodeCampus","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/276bbda2f8da73154f22fb652201cfbc"},"headline":"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial","datePublished":"2016-09-12T08:24:31+00:00","dateModified":"2025-07-03T07:39:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/"},"wordCount":507,"commentCount":37,"publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/gif.gif","articleSection":["Angular","TypeScript"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/","url":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/","name":"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial - Web Development Blog","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#primaryimage"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#primaryimage"},"thumbnailUrl":"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/gif.gif","datePublished":"2016-09-12T08:24:31+00:00","dateModified":"2025-07-03T07:39:50+00:00","breadcrumb":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#primaryimage","url":"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/gif.gif","contentUrl":"http:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2016\/09\/gif.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/www.thecodecampus.de\/blog\/angular-2-animate-creating-sliding-side-navigation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thecodecampus.de\/blog\/"},{"@type":"ListItem","position":2,"name":"Angular 2 Animate Example: Creating a Sliding Side Navigation Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.thecodecampus.de\/blog\/#website","url":"https:\/\/www.thecodecampus.de\/blog\/","name":"Web Development tips and tricks - theCodeCampus Blog","description":"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.","publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thecodecampus.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.thecodecampus.de\/blog\/#organization","name":"theCodeCampus","url":"https:\/\/www.thecodecampus.de\/blog\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","width":156,"height":156,"caption":"theCodeCampus"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/276bbda2f8da73154f22fb652201cfbc","name":"theCodeCampus","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","caption":"theCodeCampus"},"description":"Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.","sameAs":["https:\/\/www.linkedin.com\/showcase\/thecodecampus\/"],"url":"https:\/\/www.thecodecampus.de\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/comments?post=999"}],"version-history":[{"count":47,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/999\/revisions"}],"predecessor-version":[{"id":3511,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/999\/revisions\/3511"}],"wp:attachment":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/media?parent=999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/categories?post=999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/tags?post=999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}