Posts by Edmo • 768 points
38 posts
-
2
votes1
answer339
viewsQ: Unit test of a javascript fetch function with jest or mocha
I’m starting studies with TDD and came across a function like this: const fetchexample = callback => { fetch('/token', { method: 'POST', body: 'user=teste' }).then(res => res.json()).then(json…
-
-1
votes1
answer76
viewsQ: Avoid "nervous finger" switch button change
I have a switch button, and I want to do a post every time it changes from true to fake. But I need to keep the guy from clicking over and over again. And just make the change from true to false…
-
2
votes4
answers118
viewsQ: Working with Array and selecting a specific Input
In my studies in JS I have the following code: <select name='options'> <option value="a">A</option> <option value="b">B</option> <option…
-
2
votes1
answer1285
viewsQ: Display input based on a select option
I want to exhibit a input based on the option that I choose through a select. If I select 1 he shows the input 1, if I select 2 he shows the 2 but gives a hide() in the 1. Currently the code is like…
-
0
votes1
answer47
viewsQ: check if method in backend is true and client too
I have a code that in my backend it returns true or false, I am working with ruby and Rails 5. then I have la an if more or less so ja: <% if @order? %> <h2> teste 2 <h2>…
-
0
votes1
answer83
viewsQ: Trigger() in selects js
I need to create a function that when setting one of the options, the next select also changes to the same value. how could do this with this structure below? Obs: value is a hash so it will never…
-
1
votes1
answer201
viewsQ: How do I use a mixin created in another file?
I have a question about using mixin Less on different style sheets. I have 2 sheets of initial styles: reset.Less and styleguide.Less I wonder how I can in styleguide.Less define a mixin title. And…
-
3
votes1
answer793
viewsA: Anyone familiar with the Ionic framework?
Not that it’s similar, he uses Phonegap itself. Ionic does not replace the same, it is aimed at appearance and functionality but the platform is Cordova ( Phonegap ). Currently it uses the angular…
-
2
votes1
answer135
viewsQ: Change path path with Grunt
I have a problem with my application. It will be all angular, but I need to know how I can change the path of my javascript according to my environment. Example: If I’m developing in the dev…
-
0
votes3
answers1015
viewsA: How to Set Different "Row" Sizes in Bootstrap 3
If you want it to be 100% only in a certain Row I suggest you do something like: '.row .row-100' why so you would be adding property width:100% only for that specific Row. Always think scalably, how…
-
-1
votes3
answers291
viewsA: positioning of float elements without spacing
The question is in the size of the div. Pay attention that the blue div has 60px; And the rose starts soon after the same with a smaller number. In other words the problem there is the size of them.…
-
6
votes4
answers551
viewsA: When are branches useful in Git?
Good here in our company we work with our own model, but that started from the following logic: http://nvie.com/posts/a-successful-git-branching-model/ . In general terms this depends on you, if you…
-
1
votes2
answers1003
viewsQ: Angularjs Object Sharing
Someone knows a way to send an object from one angular directive to another? I have 2 directives and I need access to the object in both. I’m not getting through parameter initially since the…
-
1
votes2
answers433
viewsA: How to deploy using Grunt?
Try it with this boy: http://dploy.io/ Your API is high-explanatory. Here is the plugin: https://www.npmjs.com/package/grunt-dploy Overall you will have to do the following in Gruntfile: dploy: { //…
-
2
votes1
answer1260
viewsQ: How to get a POST parameter in REST application
I started a Rest application and have a java class createPost POST @Path("/post/") @Produces(MediaType.APPLICATION_JSON) public static String createPost(@FormParam("loopID") String loopID) throws…
-
0
votes1
answer1011
viewsQ: How to use an ng-class in the <html> tag
I’m using the Angularjs framework and need my tag to receive a dynamic class example: <html lang="en" id="ng-app" ng-app="app" ng-class="app.title"> </html> This app.title will receive a…
-
0
votes5
answers1089
viewsA: Problem with <link rel="stylesheet/Less" ... >
Try to use the Grunt or Gulp both can ensure the compilation of your Ess and several other important things like ensuring that your code is written correctly. It is something simple more powerful,…
-
0
votes1
answer132
viewsA: watch on an ng-click
After checking several options, I decided to use $broadcast, but as @Onosendai said it would be something very dirty, not to be so dirty so I created a service for the broadcast, this way always…
-
2
votes1
answer476
viewsA: Framework Javascript Extjs would be the best option for large projects?
It will depend on what exactly this project (website or website) will need. In other words frameworks like Angular, Jquery, Backbone and among others have their values there and I speak for own…
-
1
votes1
answer550
viewsQ: How to access a directive through a controller?
Can anyone tell if it is possible to access a directive through a controller? The idea is for my controller to check a flag that is instantiated in the directive since it checks to show some…
-
2
votes1
answer132
viewsQ: watch on an ng-click
I have the following input: <input type="submit" value="Publish" ng-click="submit(editAddNotification)" project-focus-invalid-field> When I run it, it inserts the change into my database (a…
-
2
votes1
answer2301
viewsQ: How to get the current date with Angularjs with refresh on date?
How to do a refresh only on an "ng-Binding" and not on the page, to get the current date via Angularjs? I have the following code: function updateTime() { scope.time = new Date(); } But I need to do…
-
3
votes3
answers129
viewsQ: How to share access between directives?
How can I call a directive, within a second directive? I have a variable x in directive 1 and I want to access this variable x in a Directive 2 so that I can say that x (diretiva 1) === y (diretiva…
-
2
votes3
answers598
viewsQ: Check if there was POST with Javascript
I have a singlepage application, and would like to monitor the POST for a webservice. When I send the information it will remove the loading. ex: scope.deleteFile = function (fileId,index) {…
-
1
votes2
answers664
viewsA: Phone book with database
You should use a query SELECT something like that: <?php $consulta=$ pdo->query("SELECT nome, usuario FROM login;"); while ($linha = $consulta->fetch(PDO::FETCH_ASSOC)) { echo "Nome:…
-
-1
votes4
answers2204
viewsA: How to get page load percentage?
As everyone has said, it’s hard to do that, since you’ll have a lot of performance issues in the future. These page loading is usually done a DOM analysis with Jquery. You pass an ID and when it…
-
0
votes2
answers452
viewsA: How to display a upload image while the iframe content is loaded?
I believe that what you want is something in that sense: http://lucasmoreira.com.br/2013/07/15/carregamento-da-pagina-com-loading/ This article is very didactic. What you will have to do is use…
-
5
votes1
answer91
viewsQ: Dynamize title with Angularjs
I want to dynamize my title page with Angularjs. It is currently static: <title>Workspace</title> I wonder how I can change that name, based on what’s written on database. Currently in a…
-
3
votes2
answers2250
viewsQ: CRUD with Angularjs
I have a single-page and I need to save the value of a variable in the database. How to do this using angular js? This variable gets the title of my single-page. This title will be customized by the…
-
0
votes1
answer337
viewsQ: Modify <title> with Angularjs through a form
I have the following code: <!-- define-pageTitle --> <div id="shareContent"> <p class="subtitle-app mt30">Define title page</p> <form onsubmit="return false">…
-
0
votes1
answer2350
viewsQ: Javascript accessibility (contrast)
I have a website that I have to have the following methods: Increase source, Decrease source, Contrast. I already got the first two, I now need to contrast with pure javascript. Has anyone ever done…
-
4
votes2
answers8268
viewsQ: how to have the current date with Angularjs
How to have the return of the current date via javascript, in the time-label class can use jquery or angular. The idea is to have the last update date. If anyone knows I’m grateful. You cannot enter…
-
0
votes1
answer5562
viewsQ: Generate pdf with Javascript or Angularjs
Does anyone know a way to generate pdf of a page via javascript without the use of library or at most with the use of JS angular ?
-
1
votes1
answer686
viewsA: Zoom Levels API Google Maps
For those who are interested, In the Google Maps documentation, there is a property called Minzoon. Just set the minimum value. Example: mapOptions = { zoom: zoom, center: new…
-
1
votes1
answer686
viewsQ: Zoom Levels API Google Maps
Can anyone tell if they can set the maximum zoom level and the minimum level in the Google Maps API? When you zoom in, the hemispheres repeat and I don’t want the user to see this. Ex of repeated…
-
4
votes4
answers4583
viewsQ: Check for image return via Javascript
How to check if the image returned with error 404 via javascript. Below an example code, I want to check if the get of this image is 404. If I want to put a certain image, if it is not going to…
-
-1
votes4
answers1399
viewsA: Databases for different customers
It’s all about business logic, I suggest you make tables, with relationships and everything that is right. Because your infrastructure wouldn’t need to be as big as if you needed separate databases.…
-
3
votes3
answers9080
viewsQ: On-demand paging with Angular or Javascript
How to make a pagination on demand with Angularjs? I have 2 particularities: 1 - No jQuery, only Angular or pure Javascript can be used. 2 - I have 2 methods the prevPage and nextPage. Below example…