Search Posts

Category: angular1.6

How to get data from span tag angular js 1

how to How to get data from span tag angular js 1 I have table <table class=”table”> <thead> <tr> <th>N0</th> <th>Produrce</th> <th>Price</th> <th>Unit</th> </tr> </thead> <tbody> <tr ng-repeat=”paym in prices”> <td>{{paym.num}}</td> <td>{{}}</td> <td>{{paym.payment}}</td> <td>{{paym.unit}}</td> </tr> </tbody> <tfoot> <tr> <td colspan=”2″><span class=”sp-total-lbl”> Total Amount</span></td> <td align=”right”><span id=”span-amount”>{{getTotal())}}</span></td> </tr> <tr> <td colspan=”4″> <button ng-click=”check_verify()” class=”btn-primary”> <i class=”material-icons”>add</i>Check </button> </td> </tr> </tfoot> </table> Here is getTotal() function $scope.getTotal =function(){ var total = 0; for(var i = 0; i […]

Angular 1.6 Component’ Template not updating under ng-repeat

The component is working perfectly fine when used individually. But If, used under ng-repeat, the DOM is not updated with fetched data .component(‘viewMore’, { templateUrl: ‘../components/clientAllData/clientAllData.html’, controller: viewMoreCtrl, controllerAs: ‘vm’, bindings: { icon: ‘<‘, clientId: ‘@’ }…. This is how I call the component in ng-repeat: <tr ng-repeat=”cfClient in selectedPS.withCF track by $index”> <td>{{}}</td> <td>{{cfClient.value | INR}}</td> <td>{{cfClient.revenue | INR}}</td> <td>{{cfClient.linked_cf}}</td> <td>{{cfClient.linked_cfValue}}</td> <td> //view-more is my component <view-more icon=”true” client-id=”{{cfClient.user_id}}”></view-more> <i class=”material-icons”>not_interested</i> </td>….. *** The […]

How to bind any patricular object property in angular component

I am new to angular 1.6 component architecture and having a simple problem. I am having one src object with having two properties within it i.e. name and age. Now, what I want is binding that name property in html. The following is the code: test.js:- $ctrl.src = { details: [ { Id: 1, Name: “Test1”, Address: “Add1” }, { Id: 2, Name: “Test2”, Address: “Add2” } ] }; test.html:- <cell-component>Hi {{Name}}</cell-component> Expected Output:- Hi […]

karma / selenium error – trying to access: http://:9876/?id=77115711

I ran karma start I am getting this: INFO [karma]: Karma v1.7.1 server started at INFO [launcher]: Launching browser selenium_chrome with concurrency 5 INFO [launcher]: Starting browser chrome via Remote WebDriver ERROR [karma]: {“message”:”[get(“http://:9876/?id=77115711”)] Error response status: 13, UnknownError – An unknown server-side error occurred while processing the command. Selenium error: unknown error: unhandled inspector error: {“code”:-32000,”message”:”Cannot navigate to invalid URL”}n (Session info: chrome=63.0.3239.84)n (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The […]

`$location` causes page to hang after redirect with `$http` Interceptor?

Can anyone help me understand why my authInterceptor, upon a 401 or 500 error, redirects OK (using $location) but the page seems to hang aftewards, and the response does not seem completed? Does sending back $q.reject(rejection) in the code below complete the request? What am I doing wrong? Note: this project is using Angular v1.6.2 app.factory(‘authInterceptor’, function($q, tokenService, $location) { return { request: function(config) { token = tokenService.getToken(); if (token) { // If token, send […]

How to enable backspace on autocomplete field angular

I have some autocomplete fields in a form that doesn’t clear the text when backspace key is pressed. I need to enable the backspace function but i dont know anything about angular js and i haven’t find anything helpful online for this case. Autocomplete is defined in a file that is called angular-material.js .Angular is version 1.6 Here is the html side of the field: <md-autocomplete flex required ng-disabled=”ctrl.isDisabled” md-no-cache=”ctrl.noCache” md-selected-item=”ctrl.selectedProvince” md-search-text=”ctrl.searchTextProvince” md-items=”item in ctrl.queryProvince(ctrl.searchTextProvince)” […]

Angular (1.x) filter not working with array of objects

I am trying to take input a search term like so: <div class=”form-group”> <input type=”text” class=”form-control” ng-model=”” placeholder=”Enter search term”> </div> And then using this search term as filter on an array of objects being rendered using ng-repeat, like so: <tbody> <tr ng-repeat=”p in vm.items track by $index | filter:”> <td><a>{{p.uid}}</a></td> <td>{{p.em}}</td> <td>{{p.ct | date:’medium’}}</td> </tr> </tbody> But in the developer’s console, I am getting the following error: dashboard-js-bundle.min.js:117 Error: [filter:notarray] at dashboard-js-bundle.min.js:6 […]

Why does my angular1.6 controller not bind correctly when I have a break point

HB.Core.Directives.directive(‘hbMultiselect’, [ function() { return { restrict: ‘E’, templateUrl: ‘/hb-core/library/directives/hb-multiselect/hb-multiselect-ptl.html’, scope: {}, controllerAs: ‘$ctrl’, bindToController: { optionsData: ‘<‘, optionsSelected: ‘=’, allSubtypesSelected: ‘=’ }, controller: function() { var $ctrl = this; // $ctrl.$onInit = function() { // console.log(this); // Tried this… didn’t work either // }; function init() { $ctrl.isExpanded = false; $ctrl.optionsDisplay = []; $ctrl.tags = []; console.log(“——“) console.log($ctrl); console.log(“——“) >>>>>>>>>>>>>>>>>>>>**BREAK POINT HERE** } init(); } }; } ]); When I run the code without […]