Questions tagged html

Explore the latest questions and answers asked by our top developers.

How can I overlap an img on top of another one in ionic

I want to create something similar to this in my design, but I’m not sure what CSS to use in ionic. This is what my code sample looks like <ion-item class=”main-container” lines=”none”> <ion-img class=”cover-img” src=”../../assets/images/logo.png” ></ion-img> </ion-item> <ion-item class=”main-container” lines=”none” style=”margin:0;”> <ion-avatar> <img src=”../../assets/images/avatar.png” /> </ion-avatar> <ion-label>Item Avatar</ion-label> </ion-item> Can anyone help me with the […]

By crystalWitchEla
Published
Categorized as angular, css, html, ionic-framework, ionic4 Tagged , , , ,

why anchor links dynamically generated by data-binding won’t jump to the targeted id when clicked

I’m working on an Angular 10 project (asp.net + angular TS), in which a FAQ text document requires using internal links for easily locating specific content. the document data is rendered from db with a data structure like { "Id": 1, "Name": "Term", "Order": 1, "Heading": "General", "Content": "How can I give an Account Name" […]

By canbrian
Published
Categorized as anchor, angular, data-binding, html, hyperlink Tagged , , , ,

Why modal does not working on Angular project?

I used bootstrap’s modal on my Angular Project, but it does not work. How can I handle with this error? I also used [ngStyle] for handling this problem with angular variables as [ngStyle]=’display: displayValue’. Also, it does not work. Code as below: <!– Button trigger modal –> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> Launch demo […]

By KiRa
Published
Categorized as angular, html, twitter-bootstrap Tagged , ,

How to make this angularjs run

The code below cannot use Local Storage even though in the previous project it worked fine. And I can’t tell why. cart.js: const app = angular.module(‘shopping-cart-app’,[]); app.controller(‘shopping-cart-ctrl’,function($scope){ $scope.cart = { items:[], add(id){ var item = this.items.find(item => item.productID == id); if(item){ item.qty++; this.saveToLocalStorage(); }else{ $http.get(`/rest/products/${id}`).then(resp =>{ resp.data.qty = 1; this.items.push(resp.data); this.saveToLocalStorage(); }).catch(error =>{ console.log("Error",error) }) […]

How to lazy-load an Angular component from an html template?

I have an existing Angular app which eager-loads everything, and I would now like to add lazy-loading capabilities to it. Lazy-loading routes works fine, especially by following the guidelines provided by https://link.medium.com/xJ18mitCElb and https://link.medium.com/8F3G2rg0slb, with the following routes construct in AppRoutingModule: {path: ‘dashboard’, loadChildren: () => import(‘./dashboard/dashboard.module’).then(m => m.DashboardModule)} Programmatically loading components is also doable […]

how is possible add javascript file in angular cli application?

I am Try replicate this effect – https://codepen.io/jonathasborges1/pen/YzryRpX in my angular app application. But I’m having a hard time applying the effect Someone can help me? "use strict"; var LeafScene = function (el) { this.viewport = el; this.world = document.createElement("div"); this.leaves = []; this.options = { numLeaves: 60, wind: { magnitude: 1.2, maxSpeed: 12, duration: […]

By jonathasborges1
Published
Categorized as angular, css, html, javascript Tagged , , ,

How to make a variable css height for a div in Angular CLI V12

I’m fairly new to developing in Angular and I’d like some help with finding the best way to create a variable CSS height in Angular CLI V12. To simplify my question by a lot I’ll present my problem as follows. I’ve got three boxes as seen below. Picture of boxes These three boxes were made […]

By bkhan1996
Published
Categorized as angular, css, html, javascript, typescript Tagged , , , ,

Angular 12 regex pattern validator

I have this in my angular template <div> <label for="password">Password</label> <input class="validation form-styling" type="password" formControlName="password" placeholder="Must contain none word characters" autocomplete="new-password" required [maxLength]="20" [minLength]="8" pattern="(?=.*d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@$!%*#?&^_-]).{8,20}"/> <div class="validation" *ngIf="this.newCustomerForm.get(‘password’).invalid && (this.newCustomerForm.get(‘password’).dirty || this.newCustomerForm.get(‘password’).touched)"> <div [hidden]="!this.newCustomerForm.get(‘password’).errors.required"> Password is required </div> <div [hidden]="!this.newCustomerForm.get(‘password’).errors.maxlength"> Password must be at most 20 characters long. </div> <div [hidden]="!this.newCustomerForm.get(‘password’).errors.minlength"> Password must be at […]

By Nesan Mano
Published
Categorized as angular, html, typescript, validation Tagged , , ,

Optgroup with ngFor

I am getting some data from backend that json looks like this: { "id":1, "name":"Colombia La Serrania Omniroast Decaf", "manufacturer":{ "id":16, "name":"3fe" }, "manufacturerId":16 I care only about 2 fields: coffee name and manufacturer name, so it is coffee.name and coffee.manufacturer.name What I want to do is to create a select with coffee name options […]

By Taxyy
Published
Categorized as angular, html, javascript Tagged , ,

Angular + Material: MatRadioButton not working when getting data from a provider

I want to implement a theme selector for my Angular app which uses the Material design but I just can’t get the radio buttons to work. I encapsulated everything related to theming in an own service, including a function getThemes() returning an array of theme names. The service is injected correctly and everything renders correctly […]

By Ercksen
Published
Categorized as angular, html, javascript Tagged , ,
1 531

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq