integrate bootstrap module and ng2-select module to angular2 5min quickstart

后端 未结 1 1855
日久生厌
日久生厌 2020-12-06 23:33

How can I integrate bootstrap module and ng2-select module to angular2 5min quickstart because I always have this error:

Une

相关标签:
1条回答
  • 2020-12-07 00:29

    To use ng2-boostrap, simply install the modules from NPM:

    $ npm install ng2-bootstrap ng2-select
    

    You can then configure them in your HTML entry file:

    <script>
      System.configure({
        map: {
          'ng2-bootstrap': 'node_modules/ng2-bootstrap',
          'ng2-select': 'node_modules/ng2-select'
        },
        packages: {
          (...)
        }
      });
      System.import(...);
    </script>
    

    You have the problem since a module can't be imported. Around your error, you should see what SystemJS tries to load something...

    Edit

    Following your answer, it appears that you need to configure moment:

    <script>
      System.configure({
        map: {
          (...)
          'moment': 'node_modules/moment/moment'
        },
        (...)
      });
    </script>
    

    See this question for more details:

    • Using moment.js in Angular 2 typescript application

    this what i found in console after i add moment

    Error: Unexpected token <(…)Zone.run @ angular2-polyfills.js:1243zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:468lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:480lib$es6$promise$$internal$$publish @ angular2-polyfills.js:451lib$es6$promise$$internal$$publishRejection @ angular2-polyfills.js:401(anonymous function) @ angular2-polyfills.js:123Zone.run @ angular2-polyfills.js:1243zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$asap$$flush @ angular2-polyfills.js:262

    the first problem has been solved when i write systemjs config but i did copied some files from my app folder to node_modules\systemjs\dist it's all the files with extension "*.js.map" i don't understand why it doesnt load it by itself and in my command window it tells me that 404 GET *****.js.map ???? have you an idea?

    0 讨论(0)
提交回复
热议问题