components

“299742-nowjedi-hello” is not a valid Custom Element name

只愿长相守 提交于 2020-07-23 07:02:21
问题 I am quite new on component development and struggling printing a simple hello world. Can someone help me? Steps to reproduce: 1. now-cli login --host stack.service-now.com 2. now-cli project --name nowjedi-hello -- description 'A web component printing Hello World' 3. npm install 4. now-cli develop --open Returns: SyntaxError: Failed to execute 'define' on 'CustomElementRegistry': "299742-nowjedi-hello" is not a valid custom element name I am following "Developing your component". Any idea

Angular6 open/show component by service

与世无争的帅哥 提交于 2020-07-22 05:52:09
问题 I built an angular component to use as a dialog for my app (e.g to show application errors) and a dialog- service to open/show that dialog from other components. dialog.component.html <kendo-dialog *ngIf="opened"> <div> Some Content </div> </kendo-dialog> dialog.compontent.ts import { Component, OnInit } from '@angular/core'; import { Dialog } from './dialog'; // Model @Component({ selector: 'dialog', templateUrl: './dialog.component.html', styleUrls: ['./dialog.component.scss'] }) export

Angular2 Update FormGroup nested value?

时间秒杀一切 提交于 2020-07-17 04:09:17
问题 I have this inside a component: private formBuilder: FormBuilder ... signupForm: FormGroup; ... this.signupForm = this.formBuilder.group({ 'name': [null, Validators.required], 'account': this.formBuilder.group({ 'email': [null, [Validators.required, ...]], 'confirm_email': [null, Validators.required], }, {validator: ValidationService.emailMatcher}), 'password': [null, [Validators.required,...]] }); And I want to set the value for the email field. I tried this, but no luck: this.signupForm

Clear button on calendar Emberjs

一世执手 提交于 2020-06-29 06:42:53
问题 Adding a clear button for a calendar but I keep receiving "Nothing handled the action" Here is the .hbs file <button class ="clearBtn" {{action "clear"}}> Clear </button> .js controller file actions: { clear(){ this.set(true, '') } }, What am I missing for the action to be called? 来源: https://stackoverflow.com/questions/62471945/clear-button-on-calendar-emberjs

Clear button on calendar Emberjs

时光怂恿深爱的人放手 提交于 2020-06-29 06:42:09
问题 Adding a clear button for a calendar but I keep receiving "Nothing handled the action" Here is the .hbs file <button class ="clearBtn" {{action "clear"}}> Clear </button> .js controller file actions: { clear(){ this.set(true, '') } }, What am I missing for the action to be called? 来源: https://stackoverflow.com/questions/62471945/clear-button-on-calendar-emberjs

Updating Parent Component State from Child Component with UseState React Hook

左心房为你撑大大i 提交于 2020-06-29 05:17:40
问题 Say I have a parent component like this: function Recipe(recipe) { const [pageState, updatePageState] = useState("view"); return ( <div className="border-b-2 border-gray-300 py-2"> <div className="h-full flex-col md:flex md:flex-row md:justify-between md:items-start"> <div className="order-2 flex flex-col flex-1 px-2 h-full md:h-72 lg:h-64 md:flex-col md:justify-between md:order-1 md:w-1/2 lg:w-3/4" > <RecipeActions pageState = {pageState} triggerParentUpdate = {state => updatePageState(state

How to call function in parent component from the child component

拜拜、爱过 提交于 2020-06-29 03:59:32
问题 I have a function called addFunc in my main Class. This class calls the RenderItem function to display a list of items. Each item has an onClick that should execute the addFunc function. I am unable to call the addFunc function from within my RenderItem function because they are in different components. How do I get past this? This is a summary of my code: const selectedData = [] class Search extends Component { constructor(props) { super(props); this.addFunc = this.addFunc.bind(this); }

Wrapping Angular components which has Parent/Child relationship

╄→尐↘猪︶ㄣ 提交于 2020-06-27 12:22:41
问题 I'm trying to wrap some third-party components with my own components (All of them are Angular 5 components). When using the third-party component (without wrapping them) I have the following code: <div> <xyz-menubar> <a xyzMenubarItem></a> <a xyzMenubarItem></a> </xyz-menubar> </div> My goal is to wrap these components to have the following code: <div> <app-menu> <app-menu-item></app-menu-item> <app-menu-item></app-menu-item> </app-menu> </div> This is how I coded the wrapped components (xyz

Wrapping Angular components which has Parent/Child relationship

ⅰ亾dé卋堺 提交于 2020-06-27 12:20:03
问题 I'm trying to wrap some third-party components with my own components (All of them are Angular 5 components). When using the third-party component (without wrapping them) I have the following code: <div> <xyz-menubar> <a xyzMenubarItem></a> <a xyzMenubarItem></a> </xyz-menubar> </div> My goal is to wrap these components to have the following code: <div> <app-menu> <app-menu-item></app-menu-item> <app-menu-item></app-menu-item> </app-menu> </div> This is how I coded the wrapped components (xyz

Asynchronous call in angular using event emitter and services for cross-component communication

戏子无情 提交于 2020-05-28 06:39:27
问题 cannot store the value received from subscribe method in a template variable. photo-detail component import { Component, OnInit, Input } from "@angular/core"; import { PhotoSevice } from "../photo.service"; import { Photo } from "src/app/model/photo.model"; @Component({ selector: "app-photo-detail", templateUrl: "./photo-detail.component.html", styleUrls: ["./photo-detail.component.css"] }) export class PhotoDetailComponent implements OnInit { url: string; constructor(private photoService: