我想在showlist.component.html中添加一些文本 ,我的showlist.component.ts代码如下,我不知道如何document.body在角度2中使用.请指导
import { Component, OnInit } from '@angular/core';
import { DOCUMENT } from '@angular/platform-browser';
@Component({
selector: 'app-showlist',
templateUrl: './showlist.component.html',
styleUrls: ['./showlist.component.css']
})
export class ShowlistComponent implements OnInit {
public myname = "saurabh";
constructor() { }
ngOnInit() {
//this.myname.appendTo(document.body);
document.body(this.myname);
//document.write(this.myname);
}
}
Run Code Online (Sandbox Code Playgroud) 我使用 Ionic 4 和 Electron 做了一个项目。我不想显示下图突出显示的默认菜单项。
这是我electron-starter.js下面的代码。我尝试过 mainWindow.removeMenu();, mainWindow.removeMenu(null);,mainWindow.setAutoHideMenuBar(hide);但没有任何效果。
我怎样才能实现这个目标?
const electron = require('electron');
// Module to control application life.
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;
const path = require('path');
const url = require('url');
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
function createWindow() { …Run Code Online (Sandbox Code Playgroud) 简要说明 - 我的html页面上有一个日期字段.选择日期后,我希望从我的home.ts文件中调用一个函数.
以下是我的home.html代码:
<ion-list>
<ion-item text-wrap *ngIf="this.myDate" style="border-radius:7px 0px 10px 7px;box-shadow: 3px 3px 3px #ececec;">
You selected {{this.myDate}} as your target date.
Run Code Online (Sandbox Code Playgroud)
我只想在
dd()选择日期后拨打电话.我该怎么办?
感谢您的帮助
编辑1:我的HTML代码
<!--
Generated template for the Dashboard2Page page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar color="headercolor" style="width:100%;">
<ion-title style="font-size:11px;">Dashboard</ion-title>
<button ion-button menuToggle>
<ion-icon name="menu" class="icon" style="color: #ffffff;font-size:17px;"></ion-icon>
</button>
</ion-navbar>
</ion-header>
<ion-content style="background-color: #f5f8fa;">
<ion-toolbar color="headercolor" style="margin-bottom:-15px;width:100%;">
<ion-segment [(ngModel)]="Task">
<!--<ion-segment-button style="margin:0px -23px -15px -23px;color: …Run Code Online (Sandbox Code Playgroud) 简要说明:我想executeAfter5secs()在打开home.ts时调用一个函数home.html.我该怎么做呢 ?
目前我已经添加了一个按钮,home.html然后点击它,该功能正在被调用,但我希望免于点击,并希望在页面加载后自动调用它,但是在5秒后.
请指导我如何在home.ts侧面编码,我有点困惑,就像我在里面编码
ngOnInit() { }
Run Code Online (Sandbox Code Playgroud)
这样一旦页面加载时间开始,5秒后我的函数被调用..
多数民众赞成,谢谢你的时间.
我正在将一个 Ionic 3 项目转移到 Ionic 4。这是一个网络项目。
扫描二维码,页面打开。网址看起来像:
domain.com/qanda/pwa/home?user=simon&skill=ionic&role=Admin&Table=132
Run Code Online (Sandbox Code Playgroud)
直到 Ionic 3,一切都很好。如果我在 Ionic 4 中添加这些参数并运行,它会打开domain.com/qanda/pwa/ - 一个空白页面,默认情况下甚至不会打开主页。
我在.htaccess旁边保留了文件,index.html以便我可以直接从 url 打开任何项目页面。下面是代码.htaccess:
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
RewriteRule (.*) https://%{HTTP_HOST}/qanda/pwa/index.html
Run Code Online (Sandbox Code Playgroud)
如何在 Ionic 4 中实现查询参数?
当我输入长文本时,该ion-input字段保持在相同的高度,我只能看到可用可见区域中的文本.在输入时,我希望输入字段根据其中的数据垂直自动调整为2行或3行.
我的page.html代码:
<ion-item>
<ion-input placeholder="type message here"></ion-input>
</ion-item>
Run Code Online (Sandbox Code Playgroud)
我附上截图以更清楚地说明我要解释的内容:
感谢您的时间和无价的支持.
我如何在cli中更改firebase项目?
当我运行firebase init时,它说:
Before we get started, keep in mind:
* You are initializing in an existing Firebase project directory
? Are you ready to proceed? (Y/n)
Run Code Online (Sandbox Code Playgroud)
它从不询问我需要上传哪个项目。请指导我如何链接我的其他项目?
要求:
我们需要在新窗口中打开一个 php 页面。我们已经这样实现了,如下所示
.html code
<a target="_blank" href="{{pdf}}">Download Pdf</a>
Run Code Online (Sandbox Code Playgroud)
.ts code
ngOnInit()
{
this.loggedinuser = localStorage.getItem("USERNAME");
console.log(this.loggedinuser);
this.pdf = 'http://219.90.67.154/report-service/quicktask/TCPDF/examples/test-tcpdf.php?loggedinuser='+this.loggedinuser;
}
Run Code Online (Sandbox Code Playgroud)
但我们想以不同的方式实现它。需要从 html 中点击一个按钮,这将调用一个函数,从这个函数中一切都应该发生。
.html
<button ion-button (click)="saveit">Save</button>
Run Code Online (Sandbox Code Playgroud)
.ts
saveit(){
// the url,html tag should be called from here , how ?
}
Run Code Online (Sandbox Code Playgroud) angular ×8
ionic2 ×5
ionic3 ×5
typescript ×3
javascript ×2
arrays ×1
electron ×1
firebase ×1
firebase-cli ×1
ionic4 ×1
jquery ×1
json ×1