module 相关问题

更大,更复杂系统的逻辑细分。

ERROR DOMException:字符串包含无效字符

HTML 文件 登录页面 {{标题}}{{文字}} HTML 文件 <div> <header>Login Page</header> <p><b>{{title}}{{text}}</b></p> <button type="button" class="btn btn-info" (click)="onClickMe($event)">Info</button> <br> <br> <rating [rating]="5"></rating> <div *ngFor="let catpicture of getPictures"> <!-- {{catpicture}} --> <catpicture [data="catpicture"]></catpicture> </div> </div> 登录组件文件 import { Component,Input } from '@angular/core'; import { catPicture } from './login.loginname'; @Component({ selector: 'catpicture', templateUrl: './login.component.html', styleUrl: './login.component.scss', providers: [catPicture] }) export class LoginComponent { title = "My First Angular App"; text = " World"; onClickMe($event: any) { console.log("Clicked",$event); } getPictures; constructor(catPicture:catPicture){ this.getPictures=catPicture.getPictures(); } // @Input()data:any } 登录名.ts export class catPicture{ getPictures(){ return [ { imageUrl: "http://loremflickr.com/150/150?random=1", pictureName: "Product 1", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:4 }, { imageUrl: "http://loremflickr.com/150/150?random=2", pictureName: "Product 2", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:3 }, { imageUrl: "http://loremflickr.com/150/150?random=3", pictureName: "Product 3", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:3 }, { imageUrl: "http://loremflickr.com/150/150?random=4", pictureName: "Product 4", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:3 } ]; } } catpicture.ts import { Component, Input } from "@angular/core"; // import { getCatpictures } from './login.canpicture'; @Component({ selector:'catpicture', template:` <div class="media"> <img class="mr-3" src="{{data.imageUrl}}" alt="GeneralPicture"> <div class="media-body"> <h5 class="mt-0">Title</h5> {{data.postDate}} <br> {{data.description}} </div> </div> `, styles:[` .media{ margin-bottom:20px; } `] }) export class catPicture{ @Input() data: any; } 模块.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { LoginComponent } from './login/login.component'; import { MovieComponent } from './movie/movie.component'; import { HomeComponent } from './home/home.component'; import { catPicture } from './login/login.loginname'; @NgModule({ declarations: [ AppComponent, LoginComponent, MovieComponent, HomeComponent, ], imports: [ BrowserModule, AppRoutingModule ], providers: [catPicture], bootstrap: [AppComponent] }) export class AppModule { } HTML页面显示如下: ERROR DOMException:字符串包含无效字符 所以我回去检查HTML代码文件,但不幸的是我不知道如何修复这个错误,因为很简单,但我是一个初学者,有人可以告诉我该怎么做吗?谢谢大家!! 我该怎么办? 在第一个 HTML 文件中,以下行需要更正。 <catpicture [data]="catpicture"></catpicture> <catpicture [data="catpicture"]></catpicture> 更改为<catpicture [data]="catpicture"></catpicture> 解决了 HTML 文件应该是这样的: <div> <header>Login Page</header> <p><b>{{title}}{{text}}</b></p> <!-- <ul> --> <!-- <li *ngFor="let loginname of loginnames"> {{loginname}} </li> --> <button type="button" class="btn btn-info" (click)="onClickMe($event)">Info</button> <br> <rating [rating]="3"></rating> <br> <rating [rating]="5"></rating> <!-- <div *ngFor="let catpicture of getPictures"> <catpicture [data]="catpicture"></catpicture> </div> --> <div *ngFor="let picture of getPictures"> <img [src]="picture.imageUrl" alt="{{ picture.pictureName }}"> <p>{{ picture.pictureName }}</p> <p>{{ picture.postDate }}</p> <p>{{ picture.description }}</p> <p>Rating: {{ picture.rating }}</p> </div>//if return object, should following HTML format type </div>

回答 3 投票 0

ERROR DOMException:字符串在 Angular 和 Typescript 中包含无效字符

HTML 文件 登录页面 {{标题}}{{文字}} HTML 文件 <div> <header>Login Page</header> <p><b>{{title}}{{text}}</b></p> <button type="button" class="btn btn-info" (click)="onClickMe($event)">Info</button> <br> <br> <rating [rating]="5"></rating> <div *ngFor="let catpicture of getPictures"> <!-- {{catpicture}} --> <catpicture [data="catpicture"]></catpicture> </div> </div> 登录组件文件 import { Component,Input } from '@angular/core'; import { catPicture } from './login.loginname'; @Component({ selector: 'catpicture', templateUrl: './login.component.html', styleUrl: './login.component.scss', providers: [catPicture] }) export class LoginComponent { title = "My First Angular App"; text = " World"; onClickMe($event: any) { console.log("Clicked",$event); } getPictures; constructor(catPicture:catPicture){ this.getPictures=catPicture.getPictures(); } // @Input()data:any } 登录名.ts export class catPicture{ getPictures(){ return [ { imageUrl: "http://loremflickr.com/150/150?random=1", pictureName: "Product 1", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:4 }, { imageUrl: "http://loremflickr.com/150/150?random=2", pictureName: "Product 2", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:3 }, { imageUrl: "http://loremflickr.com/150/150?random=3", pictureName: "Product 3", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:3 }, { imageUrl: "http://loremflickr.com/150/150?random=4", pictureName: "Product 4", postDate: "May 31, 2018", description: "Cras sit amet nibh libero, in gravida...", rating:3 } ]; } } catpicture.ts import { Component, Input } from "@angular/core"; // import { getCatpictures } from './login.canpicture'; @Component({ selector:'catpicture', template:` <div class="media"> <img class="mr-3" src="{{data.imageUrl}}" alt="GeneralPicture"> <div class="media-body"> <h5 class="mt-0">Title</h5> {{data.postDate}} <br> {{data.description}} </div> </div> `, styles:[` .media{ margin-bottom:20px; } `] }) export class catPicture{ @Input() data: any; } 模块.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { LoginComponent } from './login/login.component'; import { MovieComponent } from './movie/movie.component'; import { HomeComponent } from './home/home.component'; import { catPicture } from './login/login.loginname'; @NgModule({ declarations: [ AppComponent, LoginComponent, MovieComponent, HomeComponent, ], imports: [ BrowserModule, AppRoutingModule ], providers: [catPicture], bootstrap: [AppComponent] }) export class AppModule { } HTML页面显示如下: ERROR DOMException:字符串包含无效字符,所以我回去检查 HTML 代码文件,但不幸的是我不知道如何修复这个错误,因为很简单,但我是初学者,有人可以告诉我该怎么做吗?谢谢大家!! 我该怎么办? 在第一个 HTML 文件中,以下行需要更正。 <catpicture [data]="catpicture"></catpicture>

回答 1 投票 0

为什么 ny Nuxt 模块可以在本地工作,但当我从 NPM 导入它时却不能工作?

我制作了一个 Nuxt 3 模块,其中包含一些组件、样式表和图像。 我已将其添加到目标应用程序的 package.json 中的模块数组中: 模块:['@zadigetvoltaire/nux...

回答 1 投票 0

Heroku 部署错误:无模块错误并返回 self.load_wsgiapp()

我使用Python 3.12制作了一个项目并让它在本地工作。现在我尝试将它部署在 Heroku 上,尽管我已经安装了所有要求,但它还是给出了这一点。它还说没有名为...的模块

回答 1 投票 0

无法配置EditorJs

我有一个网页,我想在其中使用 EditorJs。其 html 是: 我有一个网页,我想在其中使用 EditorJs。其 html 是: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Button Example</title> <!-- Include Editor.js styles --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest/dist/editor.min.css" /> </head> <body> <div id="starter">Application begins here!</div> <div id="editorjs"></div> <button id="save">Save Article</button> <script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script> <script type="module" src="sampler.js"></script> </body> </html> sampler.js 文件如下所示: import {EditorJS} from '@editorjs/editorjs'; import {Header} from '@editorjs/header'; const editor = new EditorJS({ holder:"editorjs", tools:{ header:{ class:Header, inlineToolbar:['link'] }, list:{ class:List, inlineToolbar:['link','bold'] } } }) let saveBtn=document.querySelector('button') saveBtn.addEventListener('click',()=>{ editor.save().then((outputData)=>{ console.log(outputData) }) }) 我正在使用 CDN 导入,那么我在sampler.js 中的导入语句应该是什么样的。目前我收到此错误: Uncaught TypeError: Failed to resolve module specifier "@editorjs/editorjs". Relative references must start with either "/", "./", or "../" 如果是CDN引用的,则不需要导入直接使用。

回答 1 投票 0

Typescript 图像导入

我在这里找到了解决方案:Webpack & Typescript image import 但我为此收到错误: [ts] 属性“src”的类型不兼容。 类型 'typeof import("*.png")' 未分配...

回答 4 投票 0

nestjs 模块设置用于测试

我想在 mall.service.spec.ts 中测试我的商城服务 请帮忙解释为什么 npm 不工作。 // 商城.service.spec.ts 描述('MallService', () => { 出租服务:MallService beforeEach(异步...

回答 1 投票 0

在 Windows 10 上使用 LaTeX Workshop 在 VSCode 上格式化文档时由于缺少 perl 模块而出错

我在 Visual Studio Code 上安装了最新版本的 LaTeX Workshop,以及 MikTex 的最新版本和 ActivePerl: 这是为 MSWin32-x64-multi-

回答 2 投票 0

即使使用 __init__.py 也会出现 ModuleNotFoundError [重复]

我有一个具有以下结构的项目: 。 └── 项目 ├── 作业01 | ├── __init__.py | └── 旧文件.py | ├── 作业02 | ├── __init__.py ...

回答 2 投票 0

在另一个VS中导入模块

您好,我尝试在 Visual Studio 中调用另一个模块中的模块,我在 Maya 中工作,我使用 import os 并导入“nameofthefolder”,我尝试了命令“from .*** import **”,它说

回答 1 投票 0

导入错误:Python IDLE 中没有名为“speech_recognition”的模块

我正在尝试使用Python 3.5.1的语音识别模块来让我的jarvis AI语音激活!我查看了堆栈溢出并发现了一些与我类似的问题,但他们没有......

回答 12 投票 0

如何为所有 Drupal 多站点安装和启用相同的 Drupal 模块

我使用composer require来安装模块并使用ddev drush en module_name -y来启用它。 我有超过 10 个多站点。有没有办法只运行一次命令,这样我就不需要这样做

回答 1 投票 0

调试:com/intellij/openapi/roots/ModuleRootManager.getInstance 的 @NotNull 参数“module”运行“bot”参数时出错

我从 GitLab 克隆了一个存储库,当我第一次尝试在 Pycharm 中调试脚本时,抛出此错误消息:“Error running 'bot' Argument for @NotNull parameter 'module' of com/

回答 1 投票 0

在Python中如何跨模块共享大型数据结构(无副本)

我正在开发一个项目,其中使用相当大的 Pandas 数据框,并且我需要让多个函数访问它。 到目前为止,我已经使用了一个 python 脚本,其中我将数据帧创建为 glob...

回答 1 投票 0

一个包中只能公开一个库,是否有根本原因?

来自我阅读的最新版本的文档 一个包最多可以有一个未命名的库。 为什么存在这种限制?难道这只是一个可以解除的“临时”限制...

回答 1 投票 0

仅将某些导出公开到文件夹外部的文件

假设我们有一个文件夹,其中有很多文件,每个文件都导出一些内容: 立面/A.tsx 导出 const _A = () => {...}; // 此导出对于 `facade/` 之外的文件不应该可见 发...

回答 2 投票 0

不读取JavaScript模块文件中的函数,通过在html文档中调用onclick

为什么当我们在 html 文档中的“onclick”中调用函数时,如果存在“import”,则 JavaScript 模块文件中不会读取该函数? 在这种情况下是否有再次使用“onclick”的解决方案...

回答 1 投票 0

为什么 Angular ^17 我的模块、服务等出现问题

也许它已经在主题中的某个地方了。但我找不到类似的问题。问题是为什么 Angular 找不到模块和服务。我通过“ng g”创作,看来...

回答 1 投票 0

使用 IIFE 将模块添加到命名空间

我刚刚学习前端,然后我想出了一种使用 IIFE 创建模块并将其注册到命名空间的方法。从下面的代码来看,我仍然不明白一些事情: 为什么

回答 1 投票 0

我想了解java中的模块化。编译我的应用程序时,我遇到了 ResolutionException

我有 2 个使用 Gradle 和 IntelliJ Idea 创建的独立 javafx 模块化项目。第一个是一个应用程序,我将其命名为 A。第二个是一个库,我将其命名为 B。我想在我的 a 中使用库 B...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.