Search Posts

Category: angularjs-scope

Header scope and relative controller not re-executed after location search

how to Header scope and relative controller not re-executed after location search I am currently trying to solve if there is a best practice to manage the situation on subject. I have some info (like page label, menu items) stored in the scope of the Header component, and when in the central UI locations, through search mechanism, change, I need to take info back from there into my Header controller. This script below is working, […]

How to use built-in services from angularjs directives?

how to How to use built-in services from angularjs directives? I’m able to get some ID from URL using angularjs built-in $location service. Now, I need to call a service with that ID when the page loads, and then response needs to be rendered in some way. I’m using ng-init like: ng-init=”uid=$location.path().substring($location.path().lastIndexOf(‘/’) + 1); callToTheService(uid);” When I execute, this way ng-init is not be able to call the built-in service and that’s why I’m getting […]

Angular Radio default select and ng-if button not working

how to Angular Radio default select and ng-if button not working i have ng-repeat inside images and icon two radio buttons but when the page loads the default checked based on the ng-if should have to show currently the ng-if not working. HTML <div class=”carousel-div umb-grid p10 ng-scope” ng-repeat=”listitem in QuickLinkList”> <!– <a href class=”icon icon-delete red” ng-click=”removeLink(listitem)” title=”Remove Link”></a>–> <b class=”ng-binding”> Link 2</b> <div class=”p10 control-group umb-control-group”> <div class=”control-group umb-control-group”> <div class=”umb-el-wrap”> <span> <label> […]

Upload Image in AngularJS

how to Upload Image in AngularJS i encountered a problem in my code, i have a employee information update page wich includes a photo uploader, my problem is when someone uploads a big photo, lets say 3mb nothing is waiting for the upload to finish and the profile picture gets broken. This is my code, html side: <md-input-container flex> <fieldset> <div> <img data-ng-src=”{{imageURL}}” alt=”{{user.displayName}}” class=”user-profile-picture”> </div> <div data-ng-hide=”uploader.queue.length”> <input aria-label=”Upload” type=”file” nv-file-select uploader=”uploader” data-ng-model=”contacto.profileImageURL” multiple> […]

Avoid components modify parent scope components in Angular JS

Starting with Angular JS,I have read that components cannot access parent scopes, I mean, each component has its isolated scope. I read this is in order a component can modify its own data and not other components data. This helps to avoid situations where some data from a component can be modified from multiple inner components and would be difficult to resolve a problematic situation with data viewing and find which component is the problematic […]

HTML form in ng-if environment

Structure of my app is like following: <div class=”parent”> <div class=”child” ng-if=”isShown”> <div class=”child-view-1″ ng-if=”!isShown”> </div> <div class=”child-view-2″ ng-if=”isShown”> </div> </div> </div> Inside child-view-2 I have form element, and of course, it is undefined in controller, probably beacuse of ng-if (as it creates child scope). isShown variable just switches divs from child-view-1 to child-view-2. What do you suggest, how can I make form visible all time in controller? Source: AngularJS

AngularJS $http.get(…).success is not a function? [duplicate]

This question already has an answer here: $http.get(…).success is not a function 3 answers I’m trying to update code from angularjs 1.4.8 to 1.6.6, this means that i’m getting an error as .success and .error have now be deprecated…I’ve tried googling and following existing examples on stackoverflow but it just doesn’t seem to work for my code. Can some kind soul help with suggestions on what I should change the following function to: $scope.login = […]

Blank content in Bootstrap Modal for second AngularJS directive and onwards

The following is my html with AngularJS directive: <div class=”container”> <my-direc query=”Select * FROM booking”></my-direc> <my-direc query=”Select * FROM booking”></my-direc> </div> The query attribute is used by getData() to retrieve the data from MySQL database. The data will be stored into $ As my data are stored into database, so I just insert some dummy data and store it into $ in array form. Directive: var app = angular.module(“my-app”, [‘ngCookies’]); app.directive(“myDirec”, function ($parse, $http, $cookies) […]

Why the scope variable data is not passing via directive in AngularJS?

I have a html page <!DOCTYPE html> <html xmlns=””> <head> <title></title> <script src=”dependency/jquery/jquery-2.1.4.min.js”></script> <script src=”dependency/angular/angular.min.js”></script> <script src=”js/main_app.js”></script> </head> <body ng-app=”NMEFApp”> <form> <div ng-controller=”MainController”> First Name : <input type=”text” id=”txtFirstName” ng-model=”Person.firstName” /> <br /> Last Name: <input type=”text” id=”txtLastName” ng-model=”Person.lastName” /> <br /> <input type=”button” ng-click=”init();” value=”Initialize” id=”btnInit” /> <div> Hello : {{ Person.firstName }}&nbsp;{{ Person.lastName }} </div> <employee-information childperson=”Person”></employee-information> <employee-information childperson=”Child”></employee-information> </div> </form> </body> </html> and an app.js file var NMEFApp = angular.module(‘NMEFApp’, []); NMEFApp.controller(“MainController”, […]

Scoping issue – page not being updated from http post in sibling controller

I am using ng-click to call a function that request new content for the scope. Im doing that by calling a post request that is handeled by php. When I run the script I can see the updated data in the console but the page is not being updated. The HTML; <body> <div id =”error_frame” class=”system hidden”> </div> <div ng-controller=”objectNavCtrl” id = “content”> <a ng-click=”update()”>link</a> </div> <div ng-controller=”objectCtrl” > <div id=”object_container” ng-repeat=”object in objects track […]

Next Page »