Created
February 6, 2014 13:37
-
-
Save benfoxall/8844292 to your computer and use it in GitHub Desktop.
RequireJS shims for Bootstrap3 - updated from http://stackoverflow.com/questions/13377373/shim-twitter-bootstrap-for-requirejs#answer-19006921
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.config({ | |
paths: { | |
/* other paths are omitted */ | |
'bootstrap': '../libs/bootstrap' | |
}, | |
shim: { | |
'bootstrap/affix': { deps: ['jquery'], exports: '$.fn.affix' }, | |
'bootstrap/alert': { deps: ['jquery'], exports: '$.fn.alert' }, | |
'bootstrap/button': { deps: ['jquery'], exports: '$.fn.button' }, | |
'bootstrap/carousel': { deps: ['jquery'], exports: '$.fn.carousel' }, | |
'bootstrap/collapse': { deps: ['jquery'], exports: '$.fn.collapse' }, | |
'bootstrap/dropdown': { deps: ['jquery'], exports: '$.fn.dropdown' }, | |
'bootstrap/modal': { deps: ['jquery'], exports: '$.fn.modal' }, | |
'bootstrap/popover': { deps: ['jquery'], exports: '$.fn.popover' }, | |
'bootstrap/scrollspy': { deps: ['jquery'], exports: '$.fn.scrollspy' }, | |
'bootstrap/tab': { deps: ['jquery'], exports: '$.fn.tab' }, | |
'bootstrap/tooltip': { deps: ['jquery'], exports: '$.fn.tooltip' }, | |
'bootstrap/transition': { deps: ['jquery'], exports: '$.fn.transition' } | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick question I have the following require.config file :
requirejs.config({
baseUrl: 'bower_components/iidx-dist/',
paths: {
// Other dependencies
'moment':'components/momentjs/moment',
'bootstrap' : 'components/bootstrap/js/'
},
shim: {
'components/bootstrap/js/bootstrap-tooltip': { deps: ['jquery'], exports: '$.fn.tooltip' }
},
config: { 'map-loader': {
configFileName: 'stub/map/map-config-layers.json'
}
},
waitSeconds: 50
});
In my angular directive, I was trying to attach the tooltip widget.The code I am using is :
$('.myClass').tooltip() // Not getting the tooltip.
Any idea where I am going wrong ? I do not see any JS errors also I can see the tooltip is part of$.fn object. - i.e. In the console, whenI do $ .fn.tooltip(), I see the plugin