mdDataTable
mdDataTable copied to clipboard
Inject error
I have problem when i inject 'mdDataTable'. I try to inject 'ngMdIcons' but it not work. Please help me
@luongnd169 did you check the demo examples and you tried in the same way?
Noticed this too now @iamisti , injecting per demo examples
We solved this by including 'ngSanitize' and 'ngMdIcons' as app dependencies before 'mdDataTable'
I have a similar error(Uncaught Error: [$injector:modulerr]), my project structure is as follows:
`
<link rel="stylesheet" href="../../bower_components/angular-material/angular-material.min.css">
<link rel="stylesheet"
href="../../bower_components/material-design-icons/iconfont/material-icons.css">
<link rel="stylesheet" href="../../bower_components/md-data-table/dist/md-data-table-style.css">
<link rel="stylesheet" href="styles/styles.css">
<script src="../../bower_components/angular/angular.min.js"></script>
<script src="../../bower_components/angular-animate/angular-animate.min.js"></script>
<script src="../../bower_components/angular-aria/angular-aria.min.js"></script>
<script src="../../bower_components/angular-messages/angular-messages.min.js"></script>
<script src="../../bower_components/angular-mocks/angular-mocks.js"></script>
<script src="../../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../../bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="../../bower_components/angular-material/angular-material.min.js"></script>
<script src="../../bower_components/md-data-table/dist/md-data-table-templates.js"></script>
<script src="../../bower_components/md-data-table/dist/md-data-table.js"></script>
/* my module */ angular.module('app.core', [ 'ngSanitize', 'blocks.logger', 'blocks.router', 'ngMaterial', 'mdDataTable', 'ui.router' ]); `
I received the same error and had to install angular-material-icons in addition to mdDataTable
bower install angular-material-icons --save
bower install md-data-table --save
Then include both ngMdIcons
and mdDataTable
in your application
Also be sure to include all of the libraries
javascript
'public/lib/md-data-table/dist/md-data-table-templates.js',
'public/lib/md-data-table/dist/md-data-table.js',
'public/lib/angular-material-icons/angular-material-icons.js'
css
'public/lib/md-data-table/dist/md-data-table-style.css',
'public/lib/angular-material-icons/angular-material-icons.css'
before I had this error from Chrome Console
Error: [$injector:modulerr] Failed to instantiate module mdDataTable due to:
Error: [$injector:modulerr] Failed to instantiate module ngMdIcons due to:
Error: [$injector:nomod] Module 'ngMdIcons' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.5.9/$injector/nomod?p0=ngMdIcons
@closedLoop 's answer solved the problem for me but i also had to include ngSanitize to get rid of all error messages. This should be better documented in the documentation.
I follow the rules and now is asking for lodash.... man. This going to overpopulate my app's dependencies.
i think, too many depedencies @aretw0 are you leaving this directive or still using it?
@ikwijaya leaving, I'm using this instead.
@aretw0 me too.