Integrate LTE Admin Template at Angular 6

Asked

Viewed 2,908 times

0

I’m trying to integrate the administration into my project, but I couldn’t

It’s like he can’t find the files

I already gave the npm i admin-lte --save-dev

I’ve already added the files in angular.json

"styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/font-awesome/css/font-awesome.css",
              "node_modules/jvectormap/jquery-jvectormap.css",
              "node_modules/admin-lte/dist/css/AdminLTE.min.css",
              "node_modules/admin-lte/dist/css/skins/_all-skins.min.css",
              "src/styles.css"
            ],
            "scripts": ["node_modules/jquery/dist/jquery.min.js",
              "node_modules/admin-lte/dist/js/adminlte.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js",
              "node_modules/fastclick/lib/fastclick.js",
              "node_modules/jquery-slimscroll/jquery.slimscroll.js"]
          },

In two places in the same file

I’ve already followed this tutorial and nothing

I’m starting now with angular

There’s nothing in the default style.css yet, because I don’t know what it is to add

inserir a descrição da imagem aqui

[EDIT 1]

Really after I stopped and again gave an ng serve showed.

Only we’re almost there

Now it’s like this:

inserir a descrição da imagem aqui

  • already stopped the server and went up again? da a rebuild, sometimes did not compile the project, see if any error goes up in the log ng server check if the files are in the correct directory, I’ve had problems with it, go to the console and look at all the requests that gave error and try to tidy, the ones that are files for example .js, .css, .scss

  • and all folders node_modules/ are on a level above! you need to climb a level ../node_modules in all the styles[] and scripts[],of a conferred in the directories!

  • Really, only it’s still not that way, remembering that I use this template with Laravel, adding the necessary files and works well,

  • It worked @Hebertlima! You can add as a response, actually, the bootstrap I was using was different from the template, I imported it from the template and it worked after your tip. 'Cause all I really cared about was updating the page ng serve again.

  • And I was also importing the files the wrong way

  • https://github.com/TwanoO67/ngx-admin-lte

Show 1 more comment

1 answer

1


I also had problems using ready-made themes, was related to the wrong directory, according to your angular.cli the directories were pointing to the wrong place:

"node_modules/",

that should be:

"../node_modules/",

whenever it makes any changes to angular.cli it is necessary to recompile the project with ng server for the implementation of the new amendments.

  • I really wasn’t recompiling. As for the files, it was actually the folder that was wrong, but the start went on the same way. Because angular 6 no longer comes with angular.cli.json but with angular.json at the root, and because of this when referencing the files in the folder node_modules no longer needed to start with the two points before. So using "node_modules/..." also worked

  • but I see that the only problem even are the paths are wrong, you need to see all the files/directories that give 404 on console/network will help you find these files

  • It is because after node_modules the rest was all wrong rsrs

  • managed to get?!

  • 1

    Yes. Thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.