Reputation: 473
So I installed the package to meteor but now how to I use it in the code. I keep on getting errors when I run 'meteor'. It keeps telling me that I need jquery and all this other stuff. Here is a screenshot:
Do I need to import the package and then wrapper all of the html in my in a bootstrap method like this? :
bootstrap(
<h1>Hello World</h1>
);
Upvotes: 0
Views: 1135
Reputation: 73
You can add bootstrap by running the following command in cmd/terminal :
meteor add twbs:bootstrap
This should solve the problem. You can add version using following :
meteor add twbs:[email protected]
This adds the relevant dependencies(like jquery) automatically.
Upvotes: 0
Reputation: 206
make sure there is jquery packages loaded before twbs:bootstrap inside package file in .meteor folder. but the error shouldn't occur since twbs:bootstrap depends in jquery in package.js file package.js file
Package.describe({
name: 'twbs:bootstrap', // http://atmospherejs.com/twbs/bootstrap
summary: 'The most popular front-end framework for developing responsive, mobile first projects on the web.',
version: '3.3.6',
git: 'https://github.com/twbs/bootstrap.git'
});
Package.onUse(function (api) {
api.versionsFrom('[email protected]');
api.use('jquery', 'client');
var assets = [
'dist/fonts/glyphicons-halflings-regular.eot',
'dist/fonts/glyphicons-halflings-regular.svg',
'dist/fonts/glyphicons-halflings-regular.ttf',
'dist/fonts/glyphicons-halflings-regular.woff',
'dist/fonts/glyphicons-halflings-regular.woff2'
];
if (api.addAssets) {
api.addAssets(assets, 'client');
} else {
api.addFiles(assets, 'client', { isAsset: true });
}
api.addFiles([
'dist/css/bootstrap.css',
'dist/js/bootstrap.js'
], 'client');
});
Upvotes: 2