0

I am trying to integrate ng-material-treetable in angular application. https://www.npmjs.com/package/ng-material-treetable but its showing error like,

core.js:15723 ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.

but i have added BrowserModule, BrowserAnimationsModule in app.modules.ts only. Error

after searching in search engine got some ideas, following link https://angularscript.com/angular-material-tree-table-component/ also not working same error.

Package.json for reference.

"devDependencies": {
        "@angular-devkit/build-angular": "^0.13.5",
        "@angular/cli": "^7.2.2",
        "@angular/compiler-cli": "^7.0.0",
        "@angular/language-service": "^7.0.0",
        "@ckeditor/ckeditor5-angular": "^1.0.0",
        "@ckeditor/ckeditor5-build-classic": "^11.1.1",
        "@types/c3": "^0.6.0",
        "@types/chartist": "^0.9.37",
        "@types/datatables.net": "^1.10.10",
        "@types/jasmine": "~2.8.6",
        "@types/jasminewd2": "~2.0.3",
        "@types/jquery": "^3.3.6",
        "@types/node": "^8.10.43",
        "codelyzer": "~4.2.1",
        "jasmine-core": "~2.99.1",
        "jasmine-spec-reporter": "~4.2.1",
        "karma": "~1.7.1",
        "karma-chrome-launcher": "~2.2.0",
        "karma-coverage-istanbul-reporter": "~1.4.2",
        "karma-jasmine": "~1.1.1",
        "karma-jasmine-html-reporter": "^0.2.2",
        "protractor": "^5.4.0",
        "ts-node": "~7.0.0",
        "typescript": "~3.1.1"
    }
}

Thanks in advance.

1 Answer 1

1

The developer is importing BrowserModule into his package. an Angular application can only contain one import (https://angular.io/guide/ngmodule-faq#should-i-import-browsermodule-or-commonmodule). If you look at his repo, the dev has already been notified: https://github.com/mlrv/ng-material-treetable/issues/17

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your valuable answer. so can you suggest me angular tree table example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.