Я только начинаю новый проект в angular
meteor
в соответствии с:
https://angular -meteor.com / учебники / whatsapp2 / метеор / установка
И мой браузер показывает это ниже, это path
к файлу, в котором находится html
содержимое:
![browser output](https://i.stack.imgur.com/WHiN8.png)
Но в браузере должно быть только My App
. Метеор не отображает HTML-контент, а путь к контенту. Пожалуйста, дайте мне совет. Благодаря.
app.component.ts:
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar, Splashscreen } from 'ionic-native';
import template from './app.html';
@Component({
selector: 'my-app',
template
})
export class MyApp {
constructor(platform: Platform) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
if (platform.is('cordova')) {
StatusBar.styleDefault();
Splashscreen.hide();
}
});
}
}
app.module.ts:
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { BrowserModule } from '@angular/platform-browser';
import { MyApp } from './app.component';
@NgModule({
declarations: [
MyApp
],
imports: [
IonicModule.forRoot(MyApp),
BrowserModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp
],
providers: [
{ provide: ErrorHandler, useClass: IonicErrorHandler }
]
})
export class AppModule {}
main.html:
<head>
<title>Ionic2-MeteorCLI-WhatsApp</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="theme-color" content="#4e8ef7">
</head>
<body>
<ion-app></ion-app>
</body>
tsconfig.json:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5",
"skipLibCheck": true,
"stripInternal": true,
"noImplicitAny": false,
"typeRoots": [
"node_modules/@types/"
],
"types": [
"meteor-typings",
"@types/underscore"
]
},
"include": [
"client/**/*.ts",
"server/**/*.ts",
"imports/**/*.ts"
],
"exclude": [
"node_modules"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
Редактировать:
Спасибо за ответ. После редактирования формата шаблона => я получил новую ошибку. Моя страница теперь пуста (должен быть текст «Мое приложение»), и в консоли появилась новая ошибка:
ERROR RangeError: Maximum call stack size exceeded
at Object.resolveDep (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:40111)
at Injector_.get (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:39683)
at Object.resolveDep (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:40179)
at Injector_.get (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:39683)
at Object.resolveDep (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:40179)
at Injector_.get (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:39683)
at Object.resolveDep (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:40179)
at Injector_.get (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:39683)
at Object.resolveDep (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:40179)
at Injector_.get (modules.js?hash=3bc92748a65daa75c5e4de9e0dbe6210430d61f0:39683)