Questions tagged [angularjs-ng-show]

1

votes
1

answer
50

Views

ng-click doesn't work once ng-show div is moved out of overall div

I have a ng-click that shows/hides another section, which is all within the same overall div. I want to move the show/hide section to its own div, but when do this, the ng-click no longer works. My current code that works looks like this: {{$index+1}} {{item.workflow_stage}} errorIncomplete check_...
Dave
1

votes
1

answer
19

Views

AngularJS directives can't check for null [duplicate]

This question already has an answer here: Why mixing interpolation and expressions is bad practice 2 answers I am retrieving numbers (integer or float) from a MySQL database, and putting them in a form. I want a checkbox to be visible if the value is not null. However, ng-show and other directives...
Gary31
1

votes
1

answer
661

Views

Angular ng-show variable getting out of scope

I am trying to build a visual login/logout functionality this way: 1st time when opening the page, the Login link is visible and available, Logout is not. When I do submit Login dissapears and Logout is visible. I tried this with ng-show from angular. The spa page has the common menu: Register Logi...
anne
1

votes
2

answer
378

Views

AngularJS - get DB data(in js) / use ng-show(in html)

I am trying to get date from my db. And with the data I wanna use ng-show. In my js file : httpq.post('/data/instructor.asmx/PasswordAgain', postData) .then(function(data) { $scope.informs = JSON.parse(data.d.result).Table; if ($scope.informs.length > 0) { $scope.Ins_Checking = $scope.informs[0]; }...
Gorden
1

votes
1

answer
4.3k

Views

AngularJS ng-if does not work

In the controller, I have this var onComplete = function(response) { $scope.reportList = response.data; $log.info($scope.reportList); }; In the HTML, reportList is a JSON like this {packageType=1, salary=12900 }. ReportList is not an array {{ reportList.packageTypeId }}...
john323
1

votes
2

answer
305

Views

Angular ng-show how to make visible

Working on a simple contact form where I need to show an error message if the $scope is undefined. The validation part works however I can't remember how to enable the view of the message under ng-show in the html side. HTML: {{errorMessage}} JS: var $emptyContent = 'Please enter your prices.'; app...
Jesse C
1

votes
3

answer
384

Views

Hide element if condition is true

I have a directive which should allow me to change a specific mode, updating the scope as well. This works fine. The issue I'm facing now is that I need to be able to hide the element for the current mode. I'll explain it better: I have modes array: [1,2,3,4,5] and some links inside an ng-repeater:...
Nick
1

votes
3

answer
1.2k

Views

Show a div with AngularJS

I am searching how to show a div with AngularJS. I read some topic on StackOverflow but when I try to apply them, it doesn't works for my case... This is my HTML code : Blablabla Another div where is my button View dependances This is the controller : d3DemoApp.controller('controllerBubble', functio...
Anonyme
1

votes
1

answer
18

Views

Must not display more when I get data from database

I get the number of news from the database, but for example when I max limit of news such that I receive 24 news in total, then the tag 'download more news'¨ Everything plays as it should, but it must just get away such that one can not 'download more news' button. Just to show you can not download...
J. Willumsen
1

votes
1

answer
34

Views

Angularjs: ng-show not showing after set to true

Call In my controller.js I tried to: $scope.isVisible = false; myService.callMe().success(function (response) { $scope.isVisible = true; alert('enabled'); } But button 'Call' is not showing (alert was shown). What went wrong? Thanks in advance.
Zerosero
1

votes
1

answer
903

Views

Ng-show is not dynamically adding element

I have a variable called won in my controller that toggles on and off but the ng-show is not dynamically hiding/showing the elements. Why? It seems to work when I initially set won = false/true but not while the application is running. var memoryApp = angular.module('memoryApp', []); memoryApp.contr...
Andre Tran
1

votes
1

answer
1.5k

Views

Onsenui infinit scroll + AngularJS ngShow

Im trying to show a loading block when the infinite scroll is loading more list items, and its ok for the first time, but the followings does'nt work. When '$scope.isLoading = true;' the block is not visible. HTML {{i.name}} LOADING JAVASCRIPT $scope.getNextItems = function(){ if($scope.isLoading)...
Fiambre
1

votes
1

answer
441

Views

angular js ng-show is not working

Html code: {{store.name}} {{store.price}} {{store.canPurchase}} {{store.soldOut}} Add to Cart JS code: myApp.controller('StoreController', ['$scope', function($scope){ $scope.gems=[ {name: 'Azurite', price: '110.50', canPurchase: 'false', soldOut: 'true'}, {name: 'Azurite +', price: '120.50', canPur...
user2748161
1

votes
1

answer
3.5k

Views

Angular ng-show from variable set on scope of directive in link function

I would like to be able to set ng-show off a variable I set on the scope variable within the link function of an Angular customer directive. angular.module('myApp') .directive('testDir', function () { return { template: hello , link: function (scope, element, attrs) { // scope.showme=true; } }); U...
honkskillet
1

votes
1

answer
1.1k

Views

Angularjs ng-show from child scope to parent scope not refreshing

I haven't found, despite the many similar questions, how to hide a DOM element with ng-show in a parent scope from a child scope. I've got two nested controllers. In the parent one (attached to ), I'm using the youtube embed directive to be able to read the video continuously despite changing views...
user1144446
1

votes
1

answer
152

Views

ng-hide ng-show not working as it should

I am building a quiz in angular and Im trying to show a button based on whether the quiz has started. User go to their users page when logged in, and when they havent started the quiz i want to show the 'start quiz' button. During the quiz they can go their users page, but then only 'resume quiz' sh...
idontknow
1

votes
2

answer
3.1k

Views

Using $rootscope to change ng-show between controllers

What I want to do is pretty simple. I have two forms. One form is visible in the beginning and once that form is submitted it dissappears and the second form appears. I am trying to use a flag variable set at $rootscope.showFlag but it doesn't seem to work. Here is my HTML part: Add an item Add item...
madu
1

votes
1

answer
159

Views

$scope not updating on change

I'm using Satellizer for authentication, after I login, the login/register button in the header should change to logout but they don't. Here is my header directive: angular.module('pages.components.navHeader', [ 'common.services.authenticationService' ]) .directive('navHeader', function () { var di...
denislexic
1

votes
1

answer
2.1k

Views

HIde and show images with ng-repeat and ng-show and ng-hide and ng-click based on index

I have 2 columns, first column is Unselected images and button called Select picture next to it and second column is selected images and button called Remove picture. if i click Select picture button for one image at left column, it should move to right side column and it should disappear in left si...
Thilak Raj
1

votes
1

answer
33

Views

How can I show the 'No Books Found' row if null value is returned in filter?

I am trying to show a 'No Books Found!' row if angular filter returns no result in AngularJs. But I cannot somehow make it to work. Here is my html code: TITLE AUTHOR PRICE {{ book.title }} {{ book.author }} {{ book.price }} No Books Found Am I missing something? Thanks in advance!
John Roca
1

votes
2

answer
223

Views

Hide previous content on second click of the button of any loop inside ng repeat

I have a ng-show inside ng repeat. Whenever i click the comment button it shows the div tag contains comment box which shows previous comments of that list. The actual problem is when i click one comment button, it shows comment box with contents but when i click the another comment button, comment...
Shashank G
1

votes
1

answer
0

Views

How to Show and Hide My Image and Video Section Without ng-click in AngularJS

I am working online courses project. I have multiple courses fetch from data with the unique id. And My courses Id have images or video. When I clicked on my courses Id then it redirects to this page(blow code) in this page I have two section one is for images and second is for video but I want to i...
Mohammad Fareed
1

votes
2

answer
1.3k

Views

How to set ng-show on a specific element through different views/controllers?

Plunker: http://plnkr.co/edit/0efF1Av4lhZFGamxKzaO?p=preview Below is my header, there is an ng-show='cornerLogo' which I only want to be set true on the about, login and register views, but false the home view. Logo About Sign In Create Account So it works in my HomeCtrl because that is the main co...
Leon Gaban
1

votes
2

answer
40

Views

AngularJS - ngShow is not working

My view is written as follows: {{comment.name}} Delete this comment In my controller associated with this view, there is a function called: $scope.isPostedUser = function(actId, key, user) { var refComment = new Firebase(FIREBASE_URL + 'users/' + $scope.whichuser + '/activities/' + actId + '/commen...
abc
1

votes
2

answer
3.6k

Views

angularjs ng-show: show menu after successful login

I'm trying to show the navigation bar once the user logs in successfully. but the navigation-bar is still hidden even after the user logs in. here is a part of the index.html Home Demonstration the controller navigationController.js is 'use strict'; app.controller('navigationController', function ($...
AtefB
1

votes
3

answer
413

Views

How do I use angular or javascript to display value in html based on true/false return?

Note: The code below is just logic, so no parameters are defined. Although they are defined and being used actively in the same javascript file i'm in. I'm new to javascript/angularjs (I don't even know what code this is) and as of now it's really throwing me a curveball because of the syntax and ev...
cstorer
3

votes
2

answer
1.5k

Views

When to use ng-if vs ng-show/ng-hide?

I understand that ng-show and ng-hide affect the class set on an element and that ng-if controls whether an element is rendered as part of the DOM Are there any examples on choosing ng-if over ng-show/ng-hide or vice-versa?
Anil kumar
3

votes
3

answer
1.3k

Views

ng-show is blinking with angular 1.3.6 in safari

I develop a mobile web app with Ionic Framework. When I was using ionic beta-13 with angular 1.3.0, the ng-show worked fine. But after the update to ionic beta-14 with angular 1.3.6, on Safari browser the element started to blink when I navigate between views. It works fine on Chrome. UDPDATE I mad...
leonprou
3

votes
2

answer
268

Views

ngShow not working from a template on HTML

I have a problem to show and hide a div from a template on HTML page. here is a simple JSFiddle example Example. app.directive('example', function () { return { restrict: 'E', template: 'Click me', scope: { exampleAttr: '@' }, link: function (scope) { scope.clickMe = function () { scope.showMe = !sc...
Ayyoub
2

votes
1

answer
1.1k

Views

How to show list of data on flot bar chart click event with angularjs

I am pretty new to angularjs and flot bar chart I am trying to display filtered data in a list on click based on filters. I have created a custom directive to plot the chart and a custom filter which I use with data gotten on the click method but the list is not displayed. Please help take a look ht...
Ese
1

votes
1

answer
5.4k

Views

Angularjs data-ng-show not working

I'm an Angular beginner and I cannot figure out why the following code is not working. What I want to do is, display a message depending on the http api request. I get to the http success part every time, and then I set the ng-show attribute , and since it's data bind I assume it should display the...
sameera207
5

votes
3

answer
1.9k

Views

Syntax error with ng-show: “token 'false' is at column {2} of the expression [{3}] starting at [{4}]”

I'm using ng-show as shown below: The value of entity.primary can be either true or false. I am getting the following error in the console: Syntax Error: Token 'false' is at column {2} of the expression [{3}] starting at [{4}]. How can this error be fixed?
forgottofly
3

votes
2

answer
8.9k

Views

angularjs show/hide tabs, click same tab hide the content

when i click tab A, A content show when i click tab B, A content hide B content show but the effect i want is when i click tab A, A content show, click A tab again content hide. Any suggest will be help thanks a b c a b c
Xiao Xinqi
3

votes
2

answer
611

Views

ng-show and ng-if lags to hide content

I have the following in to show and hide the clear button based upon if the searchQuery is empty or not. When a user starts typing in the input box, the button shows instantly. However, when the user either clicks the clear button or deletes all input, there is a noticeable lag before the clear but...
robert
5

votes
4

answer
1.8k

Views

Why does ng-mouseover not work with ng-if

I'm trying to use 'ng-mouseover' directive on an image that has 'ng-if' and it doesn't work but If I use 'ng-show' directive it works, can everyone tell me why? Or it's an AngularJS problem? In the AngularJS documentation, I can't read anything about it: https://docs.angularjs.org/api/ng/directive/n...
Aitor
1

votes
3

answer
189

Views

How to ng-show some html content base on the current route?

I have a single page with angular and the content look like this: And when I click on some tab, for example 'Servicios', the services content is shown under the tabs. Here is the respective code: Servicios .... All this is in an unique route, for example: http://localhost:9000/#/ Now what I want is...
Kimy BF
3

votes
2

answer
88

Views

Method display on the scope is not executed

I have a set of directives that share a scope Update: The code is available as a plunk here http://plnkr.co/edit/JZ77bsZgGrw6N4K718Is?p=preview todo-item: app.directive('todoItem',function(DeleteTodo,$log){ var dirDefObj = { restrict:'E', templateUrl:'app/templates/todo.html', scope:{ todo:'=value'...
vamsiampolu
2

votes
2

answer
966

Views

Configure ng-show and ng-hide speed

Please can I modify the speed of Angular's ng-show and ng-hide? jQuery has parameters to modify the speed of show() and hide(), so I'm just wondering if that can be done with Angular. Thanks
Ladmerc
24

votes
1

answer
31.7k

Views

AngularJS - using ng-show within ng-repeat

I'm having an issue using the ng-show directive within an ng-repeat block. The boolean value does not seem to be getting passed to ng-show correctly... To show what I mean, here is a screenshot of an example I made in JSFiddle: Here is some example markup: {{ actress.name }} Was in Avengers! (should...
PhillipKregg
2

votes
1

answer
904

Views

Animation on ngShow skips first time

I am trying to animate a twitter bootstrap panel body opening/closing that is shown with ng-show in angular (version 1.3.2), by using a simple jQuery slideUp/slideDown. (I tried at first with css transitions, but couldn't do it because of unknown body height, and max-height animation was giving me p...
YomY

View additional questions