0

I am using ng-tag-input for tags input. I have followed the steps in the getting started in this link.

Getting the following error:

 Found the synthetic property @flyInOut. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.

Here's my package.json, I suspect this has something to do with versioning. Also cant find the BrowserAnimationsModule in any of the packages.:

    {
  "name": "angular-demo",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
    "e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first",
    "lint": "tslint ./app/**/*.ts -t verbose",
    "lite": "lite-server",
    "pree2e": "webdriver-manager update",
    "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
    "test-once": "tsc && karma start karma.conf.js --single-run",
    "tsc": "tsc",
    "tsc:w": "tsc -w"
  },
  "keywords": [],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@angular/common": "~2.4.0",
    "@angular/compiler": "~2.4.0",
    "@angular/core": "~2.4.0",
    "@angular/forms": "~2.4.0",
    "@angular/http": "~2.4.0",
    "@angular/platform-browser": "~2.4.0",
    "@angular/platform-browser-dynamic": "~2.4.0",
    "@angular/router": "~3.4.0",
    "angular-in-memory-web-api": "~0.2.2",
    "core-js": "^2.4.1",
    "ng2-bootstrap": "^1.4.2",
    "ng2-bs-dropdown": "^0.7.0",
    "ng2-tag-input": "^0.9.0",
    "reflect-metadata": "^0.1.8",
    "rxjs": "5.0.1",
    "systemjs": "0.19.40",
    "zone.js": "^0.7.4"
  },
  "devDependencies": {
    "concurrently": "^3.1.0",
    "lite-server": "^2.2.2",
    "typescript": "~2.0.10",
    "canonical-path": "0.0.2",
    "http-server": "^0.9.0",
    "tslint": "^3.15.1",
    "lodash": "^4.16.4",
    "jasmine-core": "~2.4.1",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~4.0.14",
    "rimraf": "^2.5.4",
    "@types/node": "^6.0.46",
    "@types/jasmine": "^2.5.36"
  },
  "repository": {}
}
SJMan
  • 1,547
  • 2
  • 14
  • 37

2 Answers2

4

Try to install the package this will fix the issue.

npm install --save @angular/animations

Import this is in your app.module.ts file

import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

@NgModule({
  ...
  imports: [BrowserAnimationsModule],
  ...
})
export class PizzaPartyAppModule { }
Vignesh
  • 2,378
  • 3
  • 25
  • 48
  • Getting the error on compile Cannot find '@angular/platform-browser/animations' – SJMan Mar 30 '17 at 12:53
  • remove node_modules folder and try to install the packages again – Vignesh Mar 31 '17 at 04:12
  • Refer the link SJMan https://github.com/angular/material2/blob/master/guides/getting-started.md – Vignesh Mar 31 '17 at 04:19
  • @SJMan Could you solve the problem? I had the npm animations module installed but NOT imported! When I import it into my angular 4.0.1 app then my ng2-tag-input problems - binding did not work - are gone !!! Thanks Vignesh! – Pascal Apr 01 '17 at 09:13
  • I'm still getting the same error deleted the folder several times npm install / npm install --save @angular/animations. Only time I can get this resolved is when I have system.conf.js file – Troy Bryant Aug 22 '17 at 01:13
  • @TroyBryant What type of error are you getting? Are you using system.js (or) webpack – Vignesh Aug 22 '17 at 04:05
  • @vignesh I've tried using web pack but getting the error above. Seems like if I use the cli to create a new project I get this error. But if I clone the repository from get the angular getting started that has the system.js then I have to add few imports but I cant use the cli to generate new components. – Troy Bryant Aug 22 '17 at 11:53
  • @vignesh I'll post it as a question shortly – Troy Bryant Aug 23 '17 at 12:11
  • @TroyBryant update the package by using this command ncu. After updating the packages remove node_modules folder and install again – Vignesh Aug 23 '17 at 12:48
  • @vignesh negative after all that still have this error AppComponent.html:5 ERROR Error: Found the synthetic property '@focusPanel. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application. – Troy Bryant Aug 23 '17 at 17:18
  • @vignesh here is the question I've posted. https://stackoverflow.com/questions/45851495/include-browseranimationsmodule – Troy Bryant Aug 24 '17 at 01:43
1

For system.js configuration file the animation package can added like this

/**
 * System configuration for Angular samples
 * Adjust as necessary for your application needs.
 */
(function (global) {
  System.config({
    paths: {
      // paths serve as alias
      'npm:': 'node_modules/'
    },
    // map tells the System loader where to look for things
    map: {
      // our app is within the app folder
      app: 'app',

      // angular bundles
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
      '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
      '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
      '@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',

      // other libraries
      'rxjs':                      'npm:rxjs',
      'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
      'primeng':                   'npm:primeng' 
    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
      app: {
        main: './main.js',
        defaultExtension: 'js'
      },
      rxjs: {
        defaultExtension: 'js'
      },
      primeng: {
          defaultExtension: 'js'
      }
    }
  });
})(this);
Vignesh
  • 2,378
  • 3
  • 25
  • 48