Search Posts

Category: typescript

Error when importing UpgradeAdapter to upgrade to Angular 4 (import declaration can only be used in a namespace or module)

I’m starting to upgrade an AngularJS app to Angular 4, and I’m trying to bootstrap it using the upgrade adapter like this in the (‘entry’ file for the app): App.ts (was previously App.js): (function () { import { UpgradeAdapter } from ‘@angular/upgrade’; var adapter = new UpgradeAdapter(); adapter.bootstrap(document.body, [‘portalHomeApp’]); angular .module(‘portalHomeApp’, [‘shared’]); I’m getting an error for the initial import of UpgradeAdapter: An import declaration can only be used in a namespace or module What […]

Controller is not registered exception when using SystemJS with Typescript in angular JS

I am trying to implement a page using typescript in AngularJS, but I am not sure what mistake I am doing in integrating the controller to the angular. Based on my understanding, controller IIFE is not getting executed though I have specified the System import in the HTML file. Please find the following files Sample.ts file import * as angular from “angular”; export class Sample{ constructor(nme: string) { this.name = nme; } public name: string; […]

Getting Error While Adding Font to an Angular 5 Project

I am new to Angular 5.I tried to add an new font for my project.I created a ‘assets’ folder in root directory and created ‘fonts’ and ‘images’ folder under assets folder.I referred an image from images folder in my project by the same way i tried to refer an font.Images are getting referred but fonts are not working for me.I am getting an error like ‘NodeInvocationException: Prerendering failed because of error: Error: Cannot find module […]

Best Technology stack to compare two large text files at front end?

I need to build a SPA Front End Application that would compare two txt files approx 2 million records each and size somewhere around 100MB each. Each file would have thousands blocks of similar data compliant to a schema template with information about fixed length. I am free to choose front end framework from Angular, React, Vue or simple HTML/JS app. What you reckon best way to process such a large data? I explored normalizr […]

Angular Http Observable doesn’t update

Hey Guys i wrote a little backend which returns some data. Now i want to fetch this data with Angular Http and show new values when i post them in the backend. So the first thing that came to my mind were Observables but currently i can fetch the data onInit but when Posting new Data to the Backend (currently just via Postman) the Fetched data wont update. So if this is the wrong approach […]

How to pass variable as property name to access value of other object in angular 2 interpolation operator?

I want to pass variable as property of other object and access the value of that property in angular 2 interpolation operator. I have two objects as below: obj1 = { “abc”:”123″, “xyz”:”456″, “pqr”:”789″} obj2 = { “123”:”name1″, “456”:”name2″, “789”:”name3″} And I want to display name1, name2 and name3 based on obj1 property names so I tried below solution but value is not getting displayed in HTML. {{obj2[“‘+obj1.abc+'”]}} How can I achieve this? Source: AngularJS

ionic 3 read stored value native storage in function ionViewDidLoad ()

I’m having a problem, I’d like to read a value saved in the Native Storage Cordova plugin in the function -> ionViewDidLoad (). Description of the function: ionViewDidLoad () = “Runs when the page has loaded. This event only happens once per page being created. If a page leaves but is cached, then this event will not fire again on a subsequent viewing. The ionViewDidLoad event is good place to put your setup code for […]

how to trigger a validation of child component from parent component OnSubmit Angular 4?

I Have forms like this, in parent i am including multiple child components each child component is formgroup. now i need to check all this child forms validation on parent form when user click OnSubmit. How should i trigger child form validations from parent on submit. I have used FormBuilder in each childcomponent. I am able to do validation when user click on child fields but if user doesn’t enter anything or touched anything and […]

how to set form validation for select form with option as placeholder in angular 2

category.component.ts export class CategoryComponent{ public categories : any = [ { name: ‘Hotel’, type: ‘Company’}, { name: ‘School’, type: ‘Company’} ]; } category.html <form name=”addCategoryForm” class=”addCategoryForm” #addCategoryForm=”ngForm” novalidate> <div class=”form-group”> <label class=”control-label”>Category Type</label> <select class=”form-control” name=”SelectCategory” [(ngModel)]=”selectcategory” #SelectCategory=”ngModel” required> <option>Category Type</option> <option *ngFor=”let category of categories”>{{category.name}} </option> </select> <button [disabled]=”!addCategoryForm.form.valid”>Save</button> </div> </form> how can i set the placeholder in select form along with form validation Source: AngularJS

Next Page »