ngDialog in mean.js application

前端 未结 3 836
北荒
北荒 2020-12-21 06:40

I have created a webapp with MeanJS. I want to use ngDialog in the application, but not sure how and where to add the ngDialog.js in the application. Im trying to inject the

3条回答
  •  太阳男子
    2020-12-21 07:05

    You should use bower to install ngDialog first. In your application root (where bower.json is located), issue the following command,

    bower install --save ngDialog

    Then, make sure you add ngDialog module in the app level. The following answer is specific to MEAN.JS.

    In file public/config.js, find the line

    var applicationModuleVendorDependencies = ['ngResource', 'ngCookies', 'ngAnimate', 'ngTouch', 'ngSanitize', 'ui.router', 'ui.bootstrap', 'ui.utils'];

    Add 'ngDialog' to the end of the list

    var applicationModuleVendorDependencies = ['ngResource', 'ngCookies', 'ngAnimate', 'ngTouch', 'ngSanitize', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngDialog'];

    Then, include ngDialog's CSS and JavaScript file into the HTML template of the Angular application.

    In file config/env/all.js, find assets.lib.css, append 'public/lib/ngDialog/css/ngDialog.min.css' to the list.

    In the same file, find assets.lib.js, append 'public/lib/ngDialog/js/ngDialog.min.js' to the list.

提交回复
热议问题