[Solved] How to push a string in typescript file? [closed]

The Channel class is only being used for type checking as far as I can tell. Channel.ts export class Channel { name: string; } Items.ts import { Channel } from ‘./Channel’; const items: Channel[] = []; // initialize to empty array const test: string[] = [“one”, “two”, “three”]; // because ‘test’ is an array of … Read more

[Solved] can we move project from Angular to Umbraco

It is perfectly possible to use Umbraco as a CMS for your application. Create API end points to give you the data you want your web application to consume. – have a look at: http://www.jondjones.com/learn-umbraco-cms/umbraco-developers-guide/umbraco-web-api/how-to-create-a-web-api-in-umbraco-in-less-than-5-minutes Then change your Angular application to point to these end points to drive your website. Change something in Umbraco, then … Read more

[Solved] Angular2: Difference between Decorators

what is difference between @Input, @output and @ViewChild. we can access child data using @output so makes @viewchild different from @Output http://learnangular2.com/inputs/ http://learnangular2.com/outputs/ http://learnangular2.com/viewChild/ what is @viewContent? any example I haven’t heard of @viewContent Is their any way to access parent content from child like we use @ViewChild to access child content You could use … Read more

[Solved] Where I can download angular 2

You simply misunderstood the concept behind developing angular projects. When you’ve downloaded the above mentioned project, you’ll find a file named package.json. It contains, among other things, the entire set of packages you want/have to use throughout your project. And this is where you can adjust your angular version. Here is an example of how … Read more

[Solved] How to include Jison into Angular?

Install to your projects package.json npm install jison -s In your tsconfig.app.json include ‘node’ in your types array within compilerOptions “compilerOptions”: { “types”: [ “node” ] } Then import it in any TypeScript file. import * as jison from ‘jison’; 3 solved How to include Jison into Angular?

[Solved] What is the significance of the attribute xpath=”1″ while constructing locators for Selenium tests

That attribute (xpath=”1″) is placed there by a browser extension named CHROPATH. It is provided by a feature they call Dynamic Attribute Support. Scolling down the page one will find a text description of how to use the tool. Scroll to Note: at the bottom of the page, or search for “Note:” within the page … Read more

[Solved] How to send Zip file in angular

Solved Thanks for all down votes with no solution providing! here is how i solved my issue hope it help those in need: View <ion-input type=”file” formControlName=”zipFiles” (change)=”zipFilesUpload($event)” placeholder=”Zip Files”></ion-input> Controller zipFiles: File = null; zipFilesUpload(event) { this.zipFiles = <File>event.target.files[0]; } approveDistributor() { const distributorForm2 = this.distributorForm.value; const fd = new FormData(); fd.append(‘files’, this.zipFiles, this.zipFiles.name); … Read more

[Solved] Issue with showing a custom context menu

The problem has to do with the way that the name this is resolved. At the moment, when your onContextMenu method is called, this is not resolved to your AppContextMenuComponent class (as you might expect). To see this in action, try inserting console.log(this) somewhere within that method. Since this is not resolved as you might … Read more

[Solved] Separate Angular apps for customers and staff

You can create a new workspace with separated projects inside ng new appName –createApplication=false This command will create empty workspace. Then you can create two separated apps and share code between them. ng g application customersApp and ng g application staffApp Now you will have projects folder in your workspace and you can run the … Read more

[Solved] How to create custom type in angular [closed]

It depends on what you mean by type exactly. If you want to define a “type” that you can use in TypeScript strong typing, then you have several choices. You can build an interface like this: export interface Product { productId: number; productName: string; productCode: string; releaseDate: string; price: number; description: string; starRating: number; imageUrl: … Read more

[Solved] ReactiveForm for dynamically updated form entries

If you use ReactiveForm, you need use a FormArray A FormArray can be of FormControl or a FormGroup FormArray of FormControls constructor(private fb:FormBuilder) {} ngOnInit() { //We create an array of FormControl, each question a FormControl let data:FormControl[]=this.questions.map(q=>new FormControl()); this.myform=this.fb.group({ questions:new FormArray(data) }) } //the .html <!–we use *ngIf to show the form only when … Read more

[Solved] Angular 2 *ngFor does not print to table , I am getting my information from a GET HTTP call and it works

you can use async pipe, you dont have to subscribe to your Observable, component.ts: export class FormationsComponent { formations: Observable<Formation[]>; constructor(private formationService: FormationService){}; ngOnInit() { this.formations = this.formationService.getFormations(); } } and in your html file <tr *ngFor=”let formation of formations | async” > 0 solved Angular 2 *ngFor does not print to table , I … Read more

[Solved] Angular 4 adding an image before each new line using renderer

this.tooltip = this.renderer.createElement(‘div’); this.tooltipTitle.split(‘,’).forEach((text) => { this.renderer.appendChild(this.tooltip, this.renderer.createText(text)); this.renderer.appendChild(this.tooltip, this.renderer.createElement(‘br’)); var img2 = document.createElement(‘img’); // Use DOM HTMLImageElement img2.src=”https://stackoverflow.com/questions/54232501/image2.jpg”; img2.alt=”alt text”; this.renderer.appendChild(this.tooltip,img2); this.renderer.appendChild(this.tooltip, this.renderer.createElement(‘br’)); this.renderer.appendChild(document.body, this.tooltip); }); Another layout 5 solved Angular 4 adding an image before each new line using renderer