Search Posts

Category: angular

Each key must be a number of string; got undefined protractor

I am trying to read data from json file but I have some trouble. How can I get items from a json file to individual items? My json file: [ { “UserName”: “test@test.en”, “Password”: “tests123” } ] My method: element(‘username’)).sendKeys(browser.params.UserName); element(‘password’)).sendKeys(browser.params.Password); as a result i get Failed: each key must be a number of string; got undefined Source: AngularJS

unable to load dynamic page in view only mode based on condition

In jade file, on particular condition i need to make the field in view only mode. but when i give the condition ng-class=”details.lockedStatus.isLocked ? ‘view’ : ‘editView’” . The page is not fully rendered…… form(name=”mainForm” class=”form-horizontal” ng-class=”details.lockedStatus.isLocked ? ‘view’ : ‘editView'”) md-content(style=””) md-tabs(md-dynamic-height=”, md-border-bottom=”) md-tab(label=’Project Details’)”color:#315a8e”) Project Infomation md-content(md-theme=’docs-dark’, style=”font-size: 16px; width: 99%;” layout-padding=” class=”border”) div(ng-repeat=”p in details.project_details” class=”col-md-3″ style=”margin-top:10px; margin-top: 10px; float: left;”) md-input-container(style=”” ng-if=”p.type == ‘text'” class=”col-md-12″) label {{p.label}} <span style=”color:#ff0000″ […]

Reload the data on each visit

I fill a list of data via API interface. For this I call the function loadData () via the view with ng-init = “loadData ()” in the controller. If I now change the view and back again, loadData () should be run again, so that new data is loaded. How can I force this? I would like to re-visit the view that the data is recalled. Source: AngularJS

Can not update view on angular4 by component intraction through service

Hello I am trying to call method of another component(ProductComponent) from a component(HeaderComponent). for this i used a service. I created a service ProductService which is a shared service amoung these components. but I doesnt update the view when the variable value is changed in service please help. here is the code productservice.service.ts import { Injectable, ChangeDetectorRef } from ‘@angular/core’; import { Observable } from ‘rxjs’; import { Subject } from ‘rxjs/Subject’; @Injectable() export class […]

How to pass variables in an Angular selector

I have an angular charComponent that creates pie, and line and other graphs which I want to embed in various places in my app. I use the selector: <chart></chart> To expose a chart. What I want to do is embed a variable into the code so I can tell the component what chart I want returning. So something like this: <chart variable=”pie-chart”></chart> Is something like this possible or is there a better way to do […]

Jhispter : angular prints null entity while retrieving objects after 1

angular .module(‘smartLpcApp’) .controller(‘CaptionsDetailController’, CaptionsDetailController); CaptionsDetailController.$inject = [‘$scope’, ‘$rootScope’, ‘$stateParams’, ‘entity’, ‘Captions’, ‘Projects’]; function CaptionsDetailController($scope, $rootScope, $stateParams, entity, Captions, Projects) { var vm = this; vm.captions = entity; console.log(“Printing entity : “+JSON.stringify(entity)); vm.load = function (id) { Captions.get({id: id}, function(result) { vm.captions = result; }); }; var unsubscribe = $rootScope.$on(‘smartLpcApp:captionsUpdate’, function(event, result) { vm.captions = result; }); $scope.$on(‘$destroy’, unsubscribe); } I am using Jhipster 1.8.5 and angular 1.5.2. This controller gets entity and displays it.While retrieving […]

Communication between app.component.ts and another component angular 2

I am a beginner in Angular 2 since I want to move my app from angular 1 to something more efficient. And I don’t understand how to make a communication between two components available. My case is I think special because I want to send some data from my app.component.ts to home.ts. These two classes are not in the same directory. Here is the architecture of my app : >src > app – app.component.ts //where […]

How to use loader while page rendering in angular 2?

I have a loader.gif image with a flag variable to show and hide. <div [hidden]=”IsLoading” class=”loadingDiv”></div> In my html having 200 records without pagination(the requirement is not need pagination). So I felt the rendering time is taking some time(around 5-10 sec). so I have planed to use loader. cutomLoad() { this.IsLoading = false; this.tyreAndRimList = this.temptyreAndRimList; // here having 200 records. this.IsLoading = true; } I have tried above code. The code run very quick […]

Dynamic Routes loading throwing error "No Factory found"

Hi I am trying to load routes dynamically returned by API server. But I get error “No Component factory found for component”.I have my components added in entryComponent here is my code. error: Uncaught (in promise): Error: No component factory found for ParentComponent. Did you add it to @NgModule.entryComponents? Error: No component factory found for ParentComponent. Did you add it to @NgModule.entryComponents? at noComponentFactoryError (core.es5.js:3202) at CodegenComponentFactoryResolver.webpackJsonp…/../../core/@angular/core.es5.js.CodegenComponentFactoryResolver.resolveComponentFactory (core.es5.js:3267) at RouterOutlet.webpackJsonp…/../../router/@angular/router.es5.js.RouterOutlet.activateWith (router.es5.js:5614) at ActivateRoutes.webpackJsonp…/../../router/@angular/router.es5.js.ActivateRoutes.activateRoutes (router.es5.js:4749) at […]

Next Page »