Skip to content

Instantly share code, notes, and snippets.

@benfoxall
Created February 6, 2014 13:37
Show Gist options
  • Save benfoxall/8844292 to your computer and use it in GitHub Desktop.
Save benfoxall/8844292 to your computer and use it in GitHub Desktop.
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' }
}
});
@AnirbanKundu
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment