ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

chore(use ng2-bootstrap): Unable to integrate ng2-bootstrap with angular2-seed.

Open devangvt opened this issue 10 years ago • 16 comments

My angular2-seed works fine. I added ng2-bootstrap 1.0.0-beta.2 to my code. When i run the code it complains of "Uncaught ReferenceError: require is not defined(anonymous function) @ ng2-bootstrap.ts:1"..

So i installed require.js post which i get error

Uncaught Error: No definition for ./components/accordion/accordion require @ require.js:21(anonymous function) @ ng2-bootstrap.ts:1

Is there a way to fix this?

devangvt avatar Jan 16 '16 03:01 devangvt

require present only in demo folder, which builded by webpack and there require is just fine if you will show me your repo I can say for sure how to fix this

valorkin avatar Jan 16 '16 10:01 valorkin

Here is my repo https://github.com/devangvt/ng2-bs2-ch2Sample. Can you please suggest the changes that i should do to get this working. I plan to integrate ng2-charts also in this repo but since i hit a roadblock in bootstrap i did not proceed with ng2-charts.

devangvt avatar Jan 16 '16 14:01 devangvt

I will take a look, I suppose in nearest time I will be creating system.js bundles :)

valorkin avatar Jan 16 '16 19:01 valorkin

i have created another repo https://github.com/devangvt/ng2withwebpack_bs-ch this one uses webpack.. I am able to use ng2-bootstrap but not ng2-charts. The ng2-charts fail to show, pie chart fails with 0 radius error, Same with doughnut chart, Tired using the bar chart but it does not show up data(but no error).. Any idea what am i doing wrong.

-Devang

On Sun, Jan 17, 2016 at 12:42 AM, Dmitriy Shekhovtsov < [email protected]> wrote:

I will take a look, I suppose in nearest time I will be creating system.js bundles :)

— Reply to this email directly or view it on GitHub https://github.com/valor-software/ng2-bootstrap/issues/82#issuecomment-172247285 .

devangvt avatar Jan 21 '16 15:01 devangvt

hm, no error is strange

valorkin avatar Jan 22 '16 09:01 valorkin

@valorkin : I have been getting the similar exception *"Uncaught ReferenceError: require is not defined(anonymous function) @ ng2-bootstrap.ts:1".. *

I am referencing only ng2-bootstrap.js in my main index html page. but it has lots of dependency on components. How can we configure our System.js to bundle them easily?

any suggestion??

jkumawat avatar Feb 16 '16 13:02 jkumawat

Usage of system.js bundles in corresponding folder will check. Please read readme.md it has how to section

On Tue, 16 Feb 2016, 14:37 Jeetendrakumar Kumawat [email protected] wrote:

@valorkin https://github.com/valorkin : I have been getting the similar exception *"Uncaught ReferenceError: require is not defined(anonymous function) @ ng2-bootstrap.ts:1".. *

I am referencing only ng2-bootstrap.js in my main index html page. but it has lots of dependency on components. How can we configure our System.js to bundle them easily?

any suggestion??

— Reply to this email directly or view it on GitHub https://github.com/valor-software/ng2-bootstrap/issues/82#issuecomment-184685246 .

valorkin avatar Feb 16 '16 17:02 valorkin

@jkumawat how did you solve the problem? I am still getting this...

hhsadiq avatar Mar 06 '16 02:03 hhsadiq

I don't get this as an issue when trying to use angular2-seed with this, but I get duplicate declarations of the methods in es6-shim for some reason.

Slavrix avatar Mar 25 '16 13:03 Slavrix

@Slavrix clean install typings

valorkin avatar Mar 25 '16 13:03 valorkin

working without any problems, check this: https://github.com/valor-software/angular2-webpack-starter/commit/f9a33992fe6555beca49bb19cf410d44fe1542b8

valorkin avatar Mar 31 '16 21:03 valorkin

I prefer to use the Quickstart that is referenced on angular.io (since that has a better chance of being kept up to date). I have not been able to get that to work with ng2 yet. Can you provide setup steps? Do I need to add a script tag in the html, or add .map to node_modules in the config, or something else? Thanks.

baloodevil avatar Apr 21 '16 15:04 baloodevil

The documentation is wrong/misleading. For the angular2-seed project, you don't need to import

<script src="node_modules/ng2-bootstrap/bundles/ng2-bootstrap.min.js"></script>

The seed project will deal with imports for you instead.

ambition-consulting avatar Apr 29 '16 12:04 ambition-consulting

Documentation is not wrong, but I should make it bold that <script src="node_modules/ng2-bootstrap/bundles/ng2-bootstrap.min.js"></script> required only for quickstarters (system.js)

valorkin avatar Apr 29 '16 14:04 valorkin

The documentation is so outdated in many places ng2-bootstrap.min.js doesn't even exist anymore.

kibbled avatar Jan 05 '17 07:01 kibbled

This is not uptodate. If you are using angular2-quickstart , please use https://github.com/valor-software/angular2-quickstart/blob/master/systemjs.config.js

AsmaGargouri avatar Mar 16 '17 10:03 AsmaGargouri