Posts by MarioAleo • 384 points
17 posts
-
0
votes2
answers174
viewsA: Create stylized HTML element using Javascript
Initially your problem is the lack of unit definition in the measures of width and height, moreover, if you really want to create elements and not just stylize some existing previously in the DOM,…
-
1
votes2
answers147
viewsA: How to perform a query within a nodeList?
The document.querySelectorAll results in a nodeList of all elements matching the selector used, if you wanted to ensure that some items do not enter your nodeList, you can increase the level of…
-
4
votes2
answers2782
viewsA: How to catch the children of an element with Javascript?
I advise you to do your searches using document.querySelector or document.querySelectorAll, with them you are able to do searches using the CSS syntax. <div id="minha-div> <span…
-
1
votes2
answers192
viewsA: How to define conditional properties for a literal object in the leanest way possible with Javascript?
Your object creation is with a wrong definition. What you are doing is a function that returns an object and not a class in javascript. With a class you can guarantee that the attribute will exist…
-
2
votes2
answers2370
viewsA: What is the difference between directives (Directive) and components (Component)?
The Component is a special Directive, it was created to address and correct problems that Directive has when Voce wants to create an html component that has a controller and an html itself, these…
-
1
votes1
answer174
viewsA: Toggle text color according to background color
You need a function that receives hexadecimal background to be able to break it into rgb and then calculate whether the source should be dark or light from the rgb values, thus returning the font…
-
0
votes2
answers170
viewsA: Java Script Animation
Jeferson, I advise you to swap your animation using the left style for the translateX style. With Transform you can know, asynchronously, when the animation ends and also you will take the main…
-
0
votes2
answers170
viewsA: How to identify the end of the monitor with jquery
Edited: Sorry, your tooltip is in an area and not in an element, so... var element = document.querySelector('.tooltip'); ... .mousemove(function(e) { /* Ajuste a Cima ou a Baixo*/ if (e.pageY +…
-
0
votes2
answers686
viewsA: Help in Deletion and Angular Editing
In particular, I advise you not to use Factory that way, especially since its variable is inside Factory, I don’t know how your application works, but if that Factory goes through the injection…
-
2
votes3
answers193
viewsA: How do I open a DIV that occupies the entire internal space of the browser?
Use CSS for this, take advantage of what the browser has to offer by default: The div: <div class="minhaDiv"></div> Your Css: .minhaDiv { position: absolute; width: 100vw; height: 100vh;…
javascriptanswered MarioAleo 384 -
1
votes2
answers51
viewsA: Variable zeroed in javascript
Primarily: A function only goes through one and only one Return (but the Returns in your function are useless because you’ve already changed the global scope variables before Return) Now, for your…
-
0
votes4
answers536
viewsA: How to share the $Scope variable from one controller to another with parameters in Angularjs
You can put the products variable in $rootScope, so you can access it from $rootScope anywhere. But I advise you to use ui-router to pass parameters, it is more cohesive and with less chances of you…
-
3
votes3
answers5987
viewsA: Save browser cache or not?
Surely there is a very big advantage in saving your site files in the cache, so the loading and the bandwidth spent by the user to access your site will be better. However, using this tag will not…
-
0
votes1
answer47
viewsA: I need to make a map with google maps api with various latitudes and longitudes, this data is from a running workout or a walk
Your Russian variable has become positionArray... when making a code, from intuitive names to variables, especially if someone reads, a simple matter of good practice var mapOptions = { zoom: 16,…
-
2
votes1
answer63
viewsA: Reuse of code with web language
What Voce wants is Web Components (https://www.w3.org/TR/components-intro/) Here is an introduction in English about: http://tableless.com.br/web-components-introducao/ Can be done with pure JS or…
-
1
votes1
answer329
viewsA: Javascript multidimensional array with angular is undefined
First, this is not an array type array (array[n][n]), what you are doing is an object that has an array in the properties (Object{x:[n]}). Ex: var i = 0; var result = null; [{Estado: "SP", Venda:…
-
2
votes1
answer348
viewsA: How to put default value on input type Hidden in Angularjs with Ionic?
If you want to pass a variable from one Controller to another, I advise you to do this through a Service that accessed by both. Example: First Controller: 'use strict';…