Search Posts

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’) md-content.md-padding h1.md-display-2(style=”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″ […]

(intermediate value).then is not a function

I have used REST API for calling put-method. When i click on the toggle_save() button my json-data is getting deleted and in the console, it shows .then is not a function HTML : <div> <button class=”btn btn-secondary” ng-hide=”editMode” ng-click=”toggle_edit()”> Edit </button> <button class=”btn btn-success” ng-show=”editMode” ng-click=”toggle_save(cts.selectedcontact)”> Save </button> </div> <b> Street:</b> <p ng-hide=”editMode”> {{cts.selectedcontact.location.street}} </p> <input type=”text” ng-show=”editMode” ng-model=”cts.selectedcontact.location.street”><br/> Angular.js: $scope.toggle_save = function(contacts){ $scope.selectedcontact = []; $http.put(‘http://localhost:3000/contacts/’ + contacts.id) data: ({ selectedcontact: contacts.selectedcontact }) .then(function […]

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 […]

Remove a row on ng-click using angularJs

I have a table with the default empty row(Row further includes a columns with different functionalities).Dynamically a multiple rows can be added by click of a button as per the requirement.i want to remove a row when i click a remove-icon from the same-row(remove-icon included in one of the column). <td class=”text-right”> <a href=”” class=”remove-service” ng-click=”vm.removeService(service,true)”> <img src=”images/delete.png”></a> &ensp;</td> i have a above column to be included in all rows.whenever i click on remove-icon from […]

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 […]

Sweet alert html option not working

Sweet alert with html option is not working can you guys explain me to solve this.or otherwise i want to bind template explicitly to sweet alert. Can you people help me to solve this sweet alert problem. swal({ title: “Are you sure?”, text: ‘<b>Hiiii</b>’ , type: “info”, showCancelButton: true, confirmButtonColor: “#F44336”, confirmButtonText: “Yes, accept it!”, closeOnConfirm: true html:true }, function() { $scope.onComment(record); }); Thanks, Siva Krishna. Source: AngularJS

AngularJS: Loading the module on specific DOM event

I’ve been banging my head for two days now. I want to load my module on specific (custom) event. This is how my page is being loaded: 1. PageLoad (tabs are loaded) 2. TabContentLoad (tab’s content being loaded via ajax call) I get this: <div ng-app=”myApp” ng-controller=”myCtrl” ng-init=”init()”> only after TabContentLoad event fires, and that is when I want to load the module. Any suggestions? Or tips to improve this architecture? Should I wrap the […]

JavaScript Redirect to URL after calling ng-click function

I have one below link <a ng-click=”logout()”><i class=”fa fa-sign-out” name=”sign-out”></i> Logout</a> I want that when I click on this link first they called their logout() function then they will redirect to the below page https://demo.testlab.local/ The problem is that client don’t want to change their code for logout() method. But I can ReWrite anything on this link only. So Is their any solution for this. Source: AngularJS

Next Page »