Posts by Giovane • 2,011 points
87 posts
-
-2
votes2
answers121
viewsA: How to reuse HTML code with pure Javascript?
Giving a quick Google I found two solutions for you, one using pure javascript from an example from W3schools itself: https://www.w3schools.com/howto/howto_html_include.asp And another using pure…
-
0
votes1
answer23
viewsA: With Docker running a different URL
Ideal is that you use environment variables to configure your application, such as database configuration for example. A simple way would be to change DB settings to: ... TypeOrmModule.forRoot({…
-
0
votes2
answers111
viewsA: Search bar "dynamic" html, css, js
Follow an example code that came to my head to guide you const searchInput = document.getElementById('search'); const searchTerms = document.getElementById('searchTerms');…
-
1
votes1
answer18
viewsA: Apply javascript to ng-include
I believe you have this problem for misusing the ngInclude, if you check the documentation, the correct ways to use: Or use as an element and set the path to the .html in the attribute src:…
-
1
votes1
answer60
viewsA: Problem with JS and id that only work with the first id used
You’re going through this trouble just by using the id, id is works as a unique identifier, so you cannot repeat it, because only the first occurrence is "valid", the others will be ignored. For…
-
-2
votes2
answers38
viewsA: Error in calling an API
Lucas, your question is very much played anyway, but I understand your problem. 1 - The error is saying that forEach is not a function of users, so that means the value that the variable users this…
-
-2
votes2
answers63
viewsA: How do you compare an item with all other items in the same list (with dictionaries inside) in a pythonic way?
Stop to think... you need to go through a list and add up the values of keys already found, correct? So you need to somehow, during the list iteration add the values by keys. So it’s clear that you…
-
3
votes1
answer17
viewsA: Negative timer when arriving at the final date
Simple, check if the difference between the current_date and the target_date is less than zero if you don’t execute the logic and stop the interval: var target_date = new Date("november 27,…
-
4
votes2
answers3405
viewsA: What does this error mean? (Assign Arrow Function to a variable before exporting as module default import/no-Anonymous-default-export)
Assign Arrow Function to a variable before exporting it as your module’s default... const myVar = () => { return <header className="header"> <img src="" alt="" /> <nav>…
-
0
votes1
answer172
viewsA: How to handle css with Vue
Come on, my recommendation is to create style classes that you want to apply on the body for the proper size of font-size. Ai in your Vue component you make the logic to apply the classes in the…
-
-2
votes1
answer110
viewsA: Restrict routes Vue router
Okay, so your route logic is to check if the user is logged in. To check whether or not it can edit, validation has to be done by logging in and trying to load the content of the post. Ai the ideal…
-
0
votes2
answers169
viewsA: How to load an image src url into Quasar/Vuejs
Whereas you are using the cli.vuejs.org to generate your project and build, I suggest using environment variable files, .env Mimics the use of Node environment variables. Then you create your files…
-
4
votes1
answer47
viewsA: How do I create an element with Vue JS?
Honestly your question is very bad, but reading the tags I think I understand more or less what you want... I understood that you want to build a form dynamically, if that’s my recommendation is you…
-
5
votes1
answer218
viewsA: What is the purpose of the nextTick() method?
Whether to use the nextTick when you need to manipulate the DOM(HTML) with an action not related to the reactivity of Vue or its life cycle. Vue updates the DOM(HTML) in a reactive way, that is,…
-
3
votes1
answer45
viewsA: It is not possible to use a v-for directive on passed prop to the Vue component
You’re having trouble rendering because you’re using DOM Template, take a look at documentation on the particularities of DOM Templates. Basically, you need to use the attribute is. Like <ul>…
-
2
votes2
answers402
viewsA: How to make a mockery (consult only after you finish typing in the input) in VUEJS?
You can do this using the Vue-Rx who is part of the rxjs the life cycle of the Vue components. See an example working: https://codesandbox.io/s/k011nv98kr Source code for the example: main.js import…
-
3
votes3
answers5591
viewsA: How to Configure CORS correctly in Spring Boot?
As I answered your other question, API at port 8000 and Angular at port 4200, how to solve?, for development the ideal is you configure a Proxy on the server @angular/cli. As I left the link of my…
-
2
votes1
answer1502
viewsA: API at port 8000 and Angular at port 4200, how to resolve?
For development is simple, just set up a proxy in the webpack dev-server. See this post I did about it, in it I explain briefly what is the CORS and how to set up proxy using the @angular/cli:…
-
2
votes3
answers59
viewsA: Redirecting users through a form
This is an example form that redirects to the url when it is submitted. (In the Stackoverflow executable it will not redirect) var baseUrl = 'http://www.exemplo.com.br'; var form =…
-
0
votes4
answers253
viewsA: maxlength in coin mask
From a glance at this code I made, it solves everything with regex, I think it still gives to improve and you can understand well because it has everything separator in small functions. const…
-
1
votes1
answer248
viewsA: Questions Properties Popover Bootstrap
Right, that’s because you’re using trigger as hover. Take a look at the Popover documentation https://getbootstrap.com/docs/4.0/components/popovers I did a very simple workaround here, if you want…
-
0
votes2
answers54
viewsA: Problems in sorting by more than one criterion
Try it like this: const data = [ { qualis: 'A1', ano: '2017' }, { qualis: 'A1', ano: '2014' }, { qualis: 'A2', ano: '2011' }, { qualis: 'A3', ano: '2012' }, { qualis: 'A6', ano: '2019' }, { qualis:…
javascriptanswered Giovane 2,011 -
0
votes1
answer761
viewsA: Problems with Lazy Load Angular 5
You should not use a relative path to load Lazy, you should use the full path from the folder app. In place of ./valor-viagem/valor-viagem.module/#ValorViagemModule Use…
-
1
votes3
answers233
viewsA: Badrequest 400 Httpparams Angular 4.3
The HttpParams are the QueryParams, the url parameters ?. Use Typescript String Interpolation to mount your url. get(codOne: number, codTwo: number): Observable<any> { return…
-
1
votes1
answer6059
viewsA: Angular 2: Please add a @Ngmodule Annotation
In his AppModule you must import the module HttpModule of @angular/http or HttpClientModule of @angular/common/http. Ai in your components and/or services Http of @angular/http or HttpClient of…
-
2
votes1
answer1813
viewsA: How to import my CSS styles and my JS scripts to an Ângular project?
I believe you have generated your project using the angular-cli, ng new. If that’s the case, just go in your file .angular-cli.json, in the events styles and scripts and report an array with all…
-
1
votes1
answer267
viewsA: Update attributes of child components
You can use $emit in the $scope of their ns-accordion-item to notify the ns-accordion when they are clicked, so the ns-accordion uses $broadcast to notify the ns-accordion-item that they should…
-
1
votes2
answers1052
viewsA: How to properly configure routes at angular 4 with Lazy loading
With the current configuration you are making you must access /clientes/listaclientes. Why? A: You are registering the path /listaclientes inside the module ClienteRoutingModule which is dynamically…
-
0
votes1
answer176
viewsA: ngRoute breaking when accessing a specific url
I believe you have not configured your server to rewrite the routes to the application. A basic rule is usually made so that if the server receives a request that results in a 404, it redirects to…
-
0
votes2
answers36
viewsA: Running Angullar 2 on http-server
To use routes without HTML5 mode, using hashbang, you need to do this configuration in your main route module: ... imports: [ ... RouterModule.forRoot(routes, { useHash: true }) ... ] ... According…
-
0
votes1
answer32
viewsA: Route not working with ui-router - Angularjs 1.6
With Ui-Router you should use its directive to route and not the default Ngroute directive. Rather than: <div ng-view></div> ou <ng-view></ng-view> You must use: <div…
-
1
votes3
answers710
viewsA: Read json via http by Angularjs
The Access-Control-Allow-Origin has to be set on the server you are requesting. This is a server security policy that defines which hosts/ips can access your services. It is not the one who consumes…
-
0
votes1
answer139
viewsA: Angular 2 has the possibility to make a string be interpreted as html?
Try: <div [innerHtml]="iframeYoutube"></div> UPDATE It really needs more stuff to insert an iframe, it had already tested with normal html, but iframe the angular blocks right away.…
-
1
votes1
answer2852
viewsA: Angular form does not take value typed in input
Try to change the (submit) for (ngSubmit). <div class="row justify-content-center" id="formulario"> <form class="form-inline" (ngSubmit)="findRegister(nameInput.value)"> <input…
-
2
votes2
answers1554
viewsA: Date mask with time
I use ui-Mask. <input type="text" ui-mask="99/99/9999 99:99:99" ui-mask-placeholder ui-mask-placeholder-char="_" /> But the ui-mask will handle no date validation, only String format. To…
-
3
votes1
answer35
viewsA: Why can’t I get the form data?
Why are you wearing mg-model rather than ng-model.
-
10
votes2
answers10403
viewsA: Back a code block in Visual Studio Code
If you want an "effect" of tab inverted: Shift + tab Take a look at the documentation of shortcuts from vscode.…
-
1
votes2
answers938
viewsA: Push in JSON Object Angularjs
The method .push() serves only to insert a new item into a Array. To insert a new attribute into an object you can do so: $scope.v.MATRICULA = '123456789' or $scope.v['MATRICULA'] = '123456789'…
-
1
votes1
answer119
viewsA: What is the most appropriate format for the Localdate field in JSON?
I think it’s ideal that the backend sends timestamp to the front and you suit the necessary. Ordination it is better to use with timestamp because it is only a number, in the Java be the type long…
-
2
votes2
answers394
viewsA: Prevent multiple Ubmit via jQuery
The problem is that with every Ubmit of your #form-principal you add a new event manager on formvalid.zf.abide. Then he will answer the N times you’ve submitted the #form-principal. If you really…
-
6
votes1
answer495
viewsA: Typeerror: $http is not a Function
You are missing declare the import of it: app.controller("controlador", ["$scope", "$http", function($scope, $http){
-
10
votes3
answers482
viewsA: Why does Angularjs default to # in the URL?
To be able to have the operation of Single Page Application, because to use normal routes direct on / would need server configuration not to have refresh on the page, which is not always so simple.…
-
2
votes1
answer430
viewsA: Directive to create div, label and input
What is missing from your code is to compile html with a scope so that it knows who to bind models to. Take a look at the Fork I made of yours plnkr. But to make it clearer, take a look here:…
angularjs-directivesanswered Giovane 2,011 -
1
votes3
answers1314
viewsA: How to read a . json file in the Angular module.config()?
As you yourself commented in another reply, it is not possible to use the $http config. I suggest you use an ajax request with pure javascript. angular.config(config); config.inject = [...]; //…
-
1
votes1
answer124
viewsA: jQuery Ajax generating image error
Gave this error because your image was not found, check if you are putting the right way. Something you can do is check if the image exists and if it does not exist you display an image message not…
-
0
votes1
answer86
viewsA: Item from the list of selected files in the input is not removed
The reason this is happening is that you are only removing the item from DOM that you created, just the line with the thumbnail and the file name, you are not removing the file from the value of…
-
0
votes3
answers623
viewsA: pass form name to jQuery
Try to do the function like this: function enviar_formulario(nome) { document[nome].submit(); } UPDATE I thought it would work that way to not change much of what you already use. Try it like this…
-
3
votes1
answer451
viewsA: Sort result of a JOIN query based on the number of records in one of the tables
Try it like this: SELECT COUNT(pi.*) AS itens, p.id AS id, p.descricao AS desc FROM pedido p INNER JOIN pedido_itens pi ON pi.id_pedido = p.id GROUP BY id, desc ORDER BY itens ASC The idea is to…
-
2
votes2
answers253
viewsA: Check and edit a List
You can try to do that: final String palavraChave = "palavra"; final String trocaPalavraChave = "<b>palavra</b>"; List<Geracao> lista = dao.findAll().stream().forEach(geracao ->…
-
2
votes2
answers679
viewsA: ocLazyLoad to load controllers from an Angularjs SPA
Well that goes from your project, I think it valid to use it to carry the controllers, services etc, when for example your application has to fit the user profile. Example: the operator user profile…