Posts

Showing posts with the label angularjs

AngularJS ng-repeat refresh with new API call

AngularJS ng-repeat refresh with new API call Currently working on an application where I'm doing an API call to get the data and then using ng-repeat directive to populate the table on the view. ng-repeat <tr md-row ng-repeat="request in requests"> <td md-cell>{{request.name}}</td> <td md-cell>{{request.email}}</td> <td md-cell>{{request.application_name}}</td> <td md-cell>{{request.created_user}}</td> <td md-cell>{{request.request_type}}</td> <td md-cell>{{request.status}}</td> </tr> And in the controller, a user makes a new request and it adds a row to the database and after the success dialog comes up, I want to make a new request to the API to get the new row that the server generated, so I want to make a new API request. So, I contact the API and get all the requests again and want to replace the data on the table with the refreshed da...

Which are best Latest web Technologies for my website [on hold]

Which are best Latest web Technologies for my website [on hold] I need best stack of latest technologies for my website which must be fast and can handle large database. Like front end , back end, database etc. Thanks in advance Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. The best solution is do your research, decide your approach, write some code, come here and ask questions when your code is not working. – daddygames Jun 29 at 20:11 Thanks @daddygames for reply. Thats the problem I am not familiar with all the web technologies but I want to bui...

ng-model does not update until I trigger the modal again [duplicate]

ng-model does not update until I trigger the modal again [duplicate] This question already has an answer here: I have a very basic bootstrap modal and when the user clicks ok it assigns $scope.accountID to a value. $scope.accountID It works perfectly ( it prints on the console the value I wanted) But the ng-model does not update until I trigger the modal again and {{accountID}} only updates after I open the modal again. {{accountID}} What is this??? Controller // when user selects a row from the table $scope.selectCustomer = function (customer) { BootstrapDialog.confirm({ title: 'Confirm customer selection', message: 'Are you sure that you want to select the customer <b>' + customer.FIRST_NAME + " " + customer.LAST_NAME + "</b> with Account ID " + customer.ACCOUNT_ID + "?", type: BootstrapDialog.TYPE_INFO, // <-- Default value is BootstrapDialog.TYPE_PRIMARY closable: true, // <-- Def...

AngularJs: How to check whether a hyperlink is loaded fully and then perform next action

AngularJs: How to check whether a hyperlink is loaded fully and then perform next action Question is simple I just want to check whether the hyperlink is loaded fully or not inside the ng-click event. HTML: Click me JS: $scope.clicked= function() { window.location='https://firstlink.com'; // //when above wesbite page is fully loaded then go to below code and load the next link // window.location='https://secondlink.com'; } NOTE: I don't want to check whether the view is loaded or not, I want to check whether the URL is completely loaded or not. I've checked many articles and posts regarding this but all I'm getting is that how to check whether your angularjs application is loaded or not. I want to get an approach with which I can check that these URLs are loaded fully or not. Below are some questions I already gone through: Post render call for AngularJs Execute AngularJs controller function on page load Sending event when angularjs finished loading Angularj...

Dynamic column table in anguler js + Type scripts

Image
Dynamic column table in anguler js + Type scripts I want to create following dynamic column table using anguler js. According to the my requirement, column sets such as fruit, vegetables can change dynamically according to the data sets. I want to load data from json file. ex: [ { "clusterID":"1", "storeCode": "S2HK", "storeName": "store 1", "Vegetables": { "Ordered":"272", "Delivery":"250", "FR":"70%", "Gap":"22" }, "Fruit": { "Ordered":"300", "Delivery":"250", "FR":"60%", "Gap":"50" } }, { "clusterID":"1", "storeCode": "SCCC", "storeName": "store 2", "Vegetables": { "Ordered":"500...

Repeat multiple rows in a table with AngularJS

Repeat multiple rows in a table with AngularJS I am attempting to create a table in AngularJS which has multiple rows per item. The output needs to be similar to: <table> <tr><td>Item 1 Row a</td></tr> <tr><td>Item 1 Row b</td></tr> <tr><td>Item 1 Row c</td></tr> <tr><td>Item 1 Row d</td></tr> <tr><td>Item 2 Row a</td></tr> <tr><td>Item 2 Row b</td></tr> <tr><td>Item 2 Row c</td></tr> <tr><td>Item 2 Row d</td></tr> </table> What would be the best way of achieving this? Is there an approach I can take that requires markup like this: <table> <tag ng-repeat="item in data"> <tr><td>Item {{item.id}} Row a</td></tr> <tr><td>Item {{item.id}} Row b</td></tr> <tr...

Angualrjs to Angular using ng-upgrade

Angualrjs to Angular using ng-upgrade I have an Angularjs application. I have to migrate it to Angular. I am following the angular tutorial - https://angular.io/guide/upgrade. My angular app.module looks like import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { UpgradeModule } from '@angular/upgrade/static'; import module from './app.module.ajs'; @NgModule({ imports: [ BrowserModule, UpgradeModule ] }) export class AppModule { constructor(private upgrade: UpgradeModule) { } ngDoBootstrap(){ this.upgrade.bootstrap(document.documentElement, [module.name], {strictDi: true}); } } I am importing my angularjs app in this file and bootstrapping it manually. I have added a main.ts file to bootstrap angular module app.module. My main .ts looks like import 'zone.js'; import 'reflect-metadata'; import { platformBrowserDynamic } from '@angular/pla...

how to place angular js controller in html

Image
how to place angular js controller in html In my angular js application we are using ui-router for routing. Currently we placed all controllers are placed in external js files and this js files are included in index.html file, but as per performance wise application loading very slow. angular js ui-router js js index.html If we are declaring controllers in html files showing error like undefined controller. can any one help this issue. Can you please share your code snippets here – vishu minhas Jun 28 at 4:50 please post your code above – Ratan Uday Kumar Jun 28 at 4:54 Looks like loading the code in the wrong order but that's really all we can tell from this...

How receive parameters passed in OPCODE in angular application [on hold]

How receive parameters passed in OPCODE in angular application [on hold] A third party application will invoke my AngularJS app, passing it the following 3 parameters: acitivityId (integer), userName and password through OPCODE (operation code). How can I retrieve the information inside the AngularJS application? I don't need to show this information in front-end app but I need to pass this information to the Java rest service. Please guide me how to implement it. Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Highcharts graph does not update with firebase

Highcharts graph does not update with firebase $scope.hhData = $firebaseArray(aRef.orderByChild('ts').startAt('2018-07-02').limitToLast(50)); $scope.hhData.$loaded().then(function () { $scope.chartSeriesYArray = ; $scope.chartSeriesXArray = ; angular.forEach($scope.hhData, function (value) { $scope.chartSeriesXArray.push(moment(value.ts).format('MMMM Do YYYY, h:mm:ss')); $scope.chartSeriesYArray.push(parseFloat(value.ein)); }); Highcharts.chart('chart', { chart: { type: 'column' }, title: { text: 'Half Hourly Energy Consumption' }, xAxis: { categories: $scope.chartSeriesXArray, crosshair: true }, yAxis: { min: 0, title: ...

Ticks marks are moving upon changing the type of Chart

Image
Ticks marks are moving upon changing the type of Chart I am using Highcharts in AngularJS. My issue is that every time I change the type of graph, the tick marks are moving along the x-axis. I don't want it to move along the x-axis. I want it to be start from the origin. Screenshots: can you provide your code sample for rendering updated charts – Hany Habib 2 days ago 1 Answer 1 Set yAxis.min = 0. yAxis.min PS: Both screenshots are the same. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.