Search Posts

Category: html

Passing user input into $http.get request angularJS

I am currently trying to pass user input into my $http.get request. I am using bootstrap and angular but am confused as I have am trying to pass two dates through a bootstrap modal. I currently have a controller like this app.controller(‘testCtrl’, function($scope, $http){ $http.get(“website” + box1 + box2).then(function(r){ $scope.Data = r.data; }); }); And a modal in bootstrap with <div class=”modal-header”> <h4 class=”modal-title”>test</h4> </div> <div class=”modal-body”> <input id=”box1″ type=”text”/> <input id=”box2″ type=”text”/> </div> <div […]

AngularJS uibModal is invisible

I created a uibModal that should open when a button is pressed. And as far as I can see in the browser Inspector it opens. The problem is, it is invisible. If I change the .fade opacity through the Browser from 0 to 1 the Modal is displayed. But that does not help me for my code. in the index.html I have following included. <link rel=”stylesheet” href=”css/bootstrap.css”> <script src=”bower_components/angular/angular.js”></script> <script src=”bower_components/angular-route/angular-route.js”></script> <script src=”bower_components/angular-animate/angular-animate.js”></script> <script src=”bower_components/angular-bootstrap/ui-bootstrap-tpls.js”></script> […]

Modal not popping up in bootstrap.When I clicked "Learn more" modal is not opening up ?Can someone tell me where i went wrong

I have provided the code below and Plunkr link as well.Modal doesn’t display properly when I click the “Learn more” button the issue araises.Can someone tell me where exactly I went wrong.The details are provided below.Well, how about adding more details. Like, what are you trying to accomplish, how are you doing it, what difficulties you have found with the approach, another approaches you have tried, etc. In summary, without code isn’t a good question […]

Display elements in scope in angularjs page

Hy everybody, first question here. I’m learning angularjs and right now i’m stuck on “Controller and Scope” chapter. I’m trying to search trough an array of objects and show items that match my query; unfortunately my screen stays blank. Here’s my code: <!DOCTYPE html> <html ng-app=””> <head> <title>Search and print with Scope</title> </head> <body> <div ng-controller=”Controller”> <input type=”search” ng-model=”q” placeholder=”CPU” /> <ul> <li ng-repeat=”proc in cpu | filter:q”> {{proc.house}} – {{proc.model}} </li> </ul> </div> <script […]

Html input max length makes the text area to be 0

I am using a directive to handle decimal functionality in my html input box as well as i have given the max length for the input type of number to be 5 when i type a value more than 5 digits the existing value in the text box becomes zero can anyone tell me why it occurs or how could i avoid this. Decimal Directive: ‘use strict’; angular.module(‘main’) .directive(‘decimalpoint’, function (CommonService) { ‘use strict’; return […]

AngularJS: How to append html via directive and toggle visibility

I’ve got a small problem: Situation is: I got a table of userdata in the view and I want to see a detail-row when I click on this table-row. The click should toggle the detail-rows visibility. What I have: HTML: <table ng-table=”userCtrl.tableParams” show-filter=”true” class=”client-table bordered highlight”> <tr ng-repeat=”client in $data” client-item> … JS: .directive(‘clientItem’, [‘$compile’, function($compile) { var directive = { restrict: ‘A’, scope: { item: ‘=item’ }, bindToController: true, controller: ClientItemController, link: linker }; […]

conditional font size in list element

I am rendering a list in html and i have to display bigger font size based on attributes. for example- <li ng-repeat=”i in items | filter:searchString”> <p>{{i.name}}</p> <p>population : {{i.population}}</p> </li> if name = state1 , population =1000 // bigger font name = state2 , population =2000 // smaller font then state1 name = state3 , population = 1500 // bigger font then state1 and smaller then state2 how to acieve that? Source: AngularJS

Dynamically check checkboxes for ng-show

I know how to do this with ng-repeat. But I can’t find a solution for this way. I have 6 checkboxes, and when I check any of them they show (ng-show) one of 6 charts. The problem is my backend sends me array for pre-checked checkboxes in this way with API. graphs_config:”[“graph.batteryVoltage”,”graph.internetUserCount”,”graph.usbAndWirelessCharging”]” I get this with $promise and check if there is data for pre-checked charts $scope.charts= userChartsFactory.get({ user: user_id }); $scope.charts.$promise.then(function(data) { if (data.graphs_config.indexOf(“graph.batteryVoltage”) […]

Next Page »