Search Posts

angularJs – handling an error and setting property of the child scope

I’ve been thinking about this problem for some time and could not figure out a solution so asking for help here. Our application app.js file has several http errors interceptors. They have the following line in them $rootScope.$broadcast(“sm:serverError”, errors); The serverError directive is added to the layout.html file which is used in all our index pages (e.g. main lists). From the index page we open the edit form and in the edit form we have […]

UI Grid Checkbox column not in synch with row.

To achieve word-wrap in grid I implemented below css but i see my checkbox is off from the remaining part of row. Row height would be dynamic. Refer above screenshot. .ui-grid-viewport .ui-grid-cell-contents {word-wrap: break-word;white-space: normal !important;} .ui-grid-row, .ui-grid-cell {height: auto !important;} .ui-grid-row div[role=row] {display: flex ;align-content: stretch;} Please advise. I will put plunker soon. But before that if someone can give any tip. Source: AngularJS

How do I write Jasmine unit tests for an AngularJS application that will eventually be upgraded to Angular 6?

So I have an AngularJS application that is going to be upgraded to Angular 6 very soon. However, the current AngularJS application has zero unit tests. Since I am tasked with doing the upgrade, I want to make sure that I have equal functionality between the legacy app and the eventual Angular 6 version, and my plan to do that is to use unit tests to ensure this. This comes with unique problems. For example, […]

AngularJS Bundle Config failing (angular-sanitize.js)

System.Web.HttpException: The controller for path ‘/bundles/angular/’ was not found or does not implement IController. This error is thrown on every page load across my application. Since I’m not bundling/minifying in Debug, this only occurs in QA/Dev and Production I’ve tried this: angular resource is mistaken as C# MVC controller (like adding the .min script tags to index.cshtml in-line, and the other suggestions) An I’ve read this: MSDN: Bundling and Minification Here is the relevant code: […]

AngularJS http status as -1 only in IE when actual http status is 302

As the title says, whenever i make an angularjs http post call, i get a status as -1 when the server returns 302 in actual. it works fine when the server returns 200 or 401 or 500. Also, this happens only in IE. Chrome or firefox works fine. This is very similar to the issue mentioned here. Except that this issue happens only in IE. Works fine in chrome and Firefox. (yes i know.. but […]

AngularJs real time table value change from data from

I am trying to update the HTML table in real time with the data coming from socket. The data from socket comes every second and sometimes even faster. I am getting the data it comprises of 200 rows of data, of which majority of the data remains same only few row data changes. I have written is code which results in browser crash – import { Component, OnInit } from ‘@angular/core’; import { HttpService } […]

Child controller trigger before parent completes all resolve in UI-Router

I have a parent route called engine. Here I am validating token, loading all db stuff, checking boolean values and navigating to different routes based on data. This whole process works fine if I navigate from parent to child but when I refresh child route its controller init function trigger first before parent resolve got finished. Here is my sample code angular.module(‘demoApp’, [‘ui.router’]) .config(routes); function routes($urlRouterProvider, $stateProvider) { $urlRouterProvider.otherwise(‘/engine/121212’); $stateProvider .state(‘engine’, { url: ‘engine/:token’, template: […]

Cancel event on change of option from dropdown

I have below code where I am taking confirmation on change of select from the dropdown. If the user selects any option from the list and then click on cancel, I want to change the option to default “select any one” on cancel event of the confirmation alert. Currently what gets selected is chosen as default. $scope.GetValue = function(newObj, oldObj) { var dialog = confirm(‘Continue?’); if (dialog) { alert(“Changing from “+oldObj+”to “+newObj); } else { […]

set a group of similarly named attributes to false

In an AngularJS project, the view model has several properties associated with navigation that begin with the word “show”. There is a function that sets these to false when called: var hideComponents = function() { vm.showAddress = false; vm.showEvent = false; vm.showAccount = false; //several others not displayed here } Is there a way to use a wildcard to set all of the properties that begin with the word “show” to false? I was thinking […]

JavaScript- Not showing the Title in Text Accordion

At first Please see the screenshot , here i am working on Accordion text Editor, where you can add title and body text. when i clicked ADD button multiple time then showing like this type. Not showing the title text. i thing it’s problem on JS file. Does any solution?? Thanks in Advance! $(document).ready(function() { $(‘#Add_btn’).click(function(){ $(‘#accordion_body’).append($(‘#editableDiv’).html()); var x = document.getElementById(“accordion_input”).value; document.getElementById(“accordion_title”).innerHTML = x; }); }); function myAccorFunction() { var Myaccordion = ‘<div class=”Myacc” id=”acc_main” […]

Next Page »