Material Desing Lite does not load in Angular 5

0

Excellent day everyone, I am using Angular 5 and I am loading Desing Lite material through its CDN into the index.html of my Angular project, but when I enter the section where I am loaded the items of Material Desing Lite will not load correctly. I have to reload the page to that they work correctly, it is worth mentioning that I have already used the JS as asynchronous but in the same way they do not load correctly.

This way I am adding my elemets (as it says in the documentation)

<form action="">
    <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
       <input class="mdl-textfield__input" type="text" id="tb-nombre">
       <label class="mdl-textfield__label" for="tb-nombre">Nombre Completo</label>
   </div>
 </form>

I hope you can help me with this, I wish you all good day :)

    
asked by Rodrigo Arenas 05.07.2018 в 18:04
source

1 answer

0

Thanks for the reply, I am very sorry for the inconvenience that I suppose that this should be put into the TS (main.ts) of my application because it should be something like this

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));

angular.module('app', ['ngRoute']).

run(function($rootScope, xxxx, xxx){
$rootScope.$on('$viewContentLoaded', function(event, next) {
    componentHandler.upgradeAllRegistered();
});
});
    
answered by 05.07.2018 в 21:02