Search Posts

Category: angular-controller

i need to store the value in angularjs function

how to i need to store the value in angularjs function im having ng-change function in the name of myFunc() to store the response from html listitem. the respose value is getting saved in the local variable of the function but when i refresh the controller or page the values are deleted. i need to store the value during ng-change in myFunc() after multiple page or controller refersh the value will be stored in the […]

add selected value from dropdown list to database angularjs php mysql

i have a dropdown list and i can access the selected name through ng_model directive(selectedName) but My problem is when i try to pass the selected option value to the database it pass a null value the query get executed and text box values are passing properly the issue is with the dropdown option values.. what went wrong .. in the controller or with the php code mysqli_real_escape_string part. it’s confused .. any help <select […]

Angular 1 Error: [ng:areq] – Controller inside Controller

I’m trying to use angular rating from this Here is my angular code. var ProfileApp = angular.module(‘ProfileApp’, [‘ui.bootstrap’]); ProfileApp.controller(‘getprofile’, function($scope, $http) { //Some codes are here }) var RatingDemoCtrl = function ($scope) { $scope.myRate = 0; $scope.submit = function() { console.log($scope.percent) ; //null } $scope.rate = 1; $scope.max = 5; $scope.isReadonly = false; $scope.percent = 20; $scope.hoveringOver = function(value,object) { console.log(‘hoveringOver’, value); $scope.overStar = value; $scope.percent = (100 * $scope.overStar) / $scope.max; }; $scope.hoveringLeave […]

Displaying json data using angularJS in html page

I am trying to display data which is in json file in table using angularJS, but I get blank page as an output. The code is below. I have separate json file and separate js file in which I have defined angular controller. When I ran the application I got a blank page as an output. View: <!DOCTYPE html> <html xmlns=”” ng-app=”angularTable”> <head> <title></title> <link href=”content/bootstrap.min.css” rel=”stylesheet” /> </head> <body> <div role=”main” class=”container theme-showcase”> <div […]

Angularjs: how do i pass a value from a form to a other form?

i need to get the Id from a table and pass it to a controller, i did something like that but the id value is lost every time i change the form, i would like know if there is a way to do that,i added the service code, and the controllers code //Here in get the IdValue app.controller(‘SeguimientoSolicitudesController’, [‘$scope’, ‘ParametrosSolicitudes’, function ($scope, ParametrosSolicitudes) { this.SegSolic = “”; var self = this; $scope.ValorId = function (value) […]

calling an angular controller method via ng-click in es6

I’m testing using es6 with angular 1.6 using browserify and babelify in gulp and I’ve noticed that when I create a controller using es6 class I can no longer call the controller’s methods on the dom using ng-click. controller: export default class FocusbtnsController { constructor($scope) {} testMethod() { alert(‘test method works!!’); } } main module: import angular from ‘angular’; import FocusbtnsController from ‘./focusbtns.controller’; export default angular.module(‘shapesite’, []) .controller(‘FocusbtnsController’, FocusbtnsController); HTML: <div class=”center-btns ng-scope” ng-controller=”FocusbtnsController”> <div […]

Routing issue with angular directives

I’m trying to setup one of my first angular projects and am having trouble getting to grips with the routing. On page load I see the initial template that has been set by the preferencesDirective, which is great. When I click the “Change Template” button I want it to change to another template but nothing happens. If I set the template url’s in the $routeProvider to something invalid then I see a 404 error in […]