Skip to content

Instantly share code, notes, and snippets.

@sifu
Created February 11, 2016 12:30
Show Gist options
  • Save sifu/41edf90ca4963238b67e to your computer and use it in GitHub Desktop.
Save sifu/41edf90ca4963238b67e to your computer and use it in GitHub Desktop.
make angular-new-router (v0.5.3) and gulp-ng-templates work together
function dashCase( str ) {
return str.replace( /([A-Z])/g, function( $1 ) {
return '-' + $1.toLowerCase( );
} );
}
$componentLoaderProvider.setTemplateMapping( function( name ) {
var dashName = dashCase(name);
return 'components/' + dashName + '/' + dashName + '.html';
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment