从<body>标签

时间:2019-06-13 09:01:57

标签: javascript angular routing

该应用具有route "/skillss",而app.component.html具有<router-outlet></router-outlet>

从Android设备调用

updateFromAndroid()方法,并且该方法被成功调用,并且成功获得data,但是在 window.location.href = "/skillss"在Android应用中。

如何在此处布线并解决以下错误。

错误是:-

"Angular is running in the development mode. Call enableProdMode() to enable the production mode.", source: https://qa1.abc.ai/skills/vendor.js (61108).
"ERROR", source: ng:///SkillsModule/SkillsComponent.ngfactory.js (929)
"ERROR CONTEXT", source: ng:///SkillsModule/SkillsComponent.ngfactory.js (929)
"ERROR", source: https://qa1.abc.ai/skills/vendor.js (59660)

index.html

<body>
    <app-root></app-root>
    <script type="text/javascript">
        function updateFromAndroid(data) {
            alert('hi');
            alert(JSON.stringify(data));
           // $.jStorage.set('currentAccount', data);
            window.location.href = "/skillss"
        }
    </script>
</body>

main.ts

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));

0 个答案:

没有答案