Posts by celsomtrindade • 8,038 points
240 posts
-
1
votes1
answer255
viewsA: Show factorial output with Angularjs
Very simple! How are you referencing in your h1 directly a function, just put so in your html {{ resultado() }} ready, it will work. Behold: <input type="text" ng-model="numero"…
-
9
votes2
answers45970
viewsA: Limit text display by number of CSS characters
A similar result can be obtained using the unit ch, would not be exactly by number of characters, but would be very close. This happens because the measure is made by the amount of 0 defined in…
-
1
votes2
answers615
viewsA: Error and Mysql: [ngRepeat:dupes] Duplicates in a Repeater are
As stated in friend Ziron’s reply, you should make sure that the element used in the track by be unique, not repeated in another element. For example, a id obtained from the database. For this we…
-
1
votes3
answers926
viewsA: Using find at angular
One solution, which I particularly prefer, is to use a function existing only in the scope of the directive, so you don’t need to do "some fix", "hacks" or worse, depend on a function of a…
-
3
votes1
answer1462
viewsA: *ngFor with angular2
Following only the pattern of Angular2 the correct syntax would be this: <div *ngFor="#hero of heroes">{{hero.fullName}}</div> Where it just replaces the same function of ng-repeat of…
-
2
votes2
answers1915
viewsA: How to use Directive templateUrl with external controller?
Although Thavia’s solution might work, it will depend on its use. I particularly don’t like to use controller explicitly defined in directive, or if you want controller with directive, because it…
-
1
votes2
answers783
viewsA: How do I use ng-messages to show $http errors?
From what I understand of ngMessage, to create a validation that is not standard, you would need to link this to a custom directive where it would do this validation and consequently you can display…
-
3
votes1
answer875
viewsQ: Rewrite module in . htaccess for subfolders
I have an application in AngularJs with html5 enabled, which makes me need to use the module rewrite apache so there is a correct URL conversion. I have no problem using this when accessing the…
-
12
votes1
answer2752
viewsA: What are the differences between Grunt and Gulp?
What are they for? Simply and simply, both serve to automate and simplify your workflow and processes. For example, I use Grunt to process my files in SASS and generate a CSS minificado, without…
-
3
votes4
answers176
viewsA: Do not show "overflow" arrows
An alternative that I found (I don’t know if the best one, because I never had to do it) would be using a negative margin in the div. For example: table tbody tr td { border:1px solid #ccc;…
-
1
votes1
answer929
viewsA: Route to Angular home page
The problem is that you enabled html5, so that the route system works properly using $locationProvider.html5Mode(true); you should also set the root of your app. This is done inside your head…
-
7
votes1
answer3726
viewsA: What’s the difference and when to use @mixin and @extend on SASS?
The use of @mixin and @extend may seem similar and have the same purpose, although this is true, they have different purposes as well as their pros and cons. Both, if used incorrectly, can become a…
-
2
votes1
answer3726
viewsQ: What’s the difference and when to use @mixin and @extend on SASS?
Both the @mixin like the @extend seem to have the same goal: Add a standard code block to a class. But if they have the same purpose, what is the difference between them? And when should I use one…
-
1
votes1
answer87
viewsA: Loop problem with $stateChangeStart
First, there is nothing really stopping the continuation of the code, IE, it will read your code and independent of having a session or not, the var authorized will be validated as true and it will…
-
2
votes1
answer139
viewsA: How to Rescue JSON External Data
To use inside the controller, you need to pass the service of $http which is being used, as follows: App.controller('ListaCtrl', ['$scope', '$http', function($scope, $http){ $scope.id = 1;…
angularjsanswered celsomtrindade 8,038 -
1
votes1
answer241
viewsA: PHP Rest Application with Logged in User
In that case, your front-end is irrelevant, I’d say. You can store the user data in cookie or Storage (the angular has this service already integrated), preferably cookie that you can control the…
-
2
votes1
answer930
viewsA: Use variable with site address in HTML - Angular
The problem of using the following definition in an image: <img src="{{meuValor}}" /> It is that HTML will render before Angular can apply the correct value of meuValor and insert the…
-
0
votes2
answers266
viewsA: Angularjs directives and compatibility
The directives, I am obliged to create them if I want to use a certain plugin? No. Directives serve for you to create some element in your project, preferably that can be reused in another area…
angularjsanswered celsomtrindade 8,038 -
2
votes1
answer97
viewsA: How to fix a menu with jQuery?
You are starting HTML with the class .fixar. Remove it from your html and everything should be resolved. Change this: <div class="topo fixar"> That’s why: <div class="topo"> Explaining:…
-
1
votes0
answers354
viewsQ: Nodejs for real-time applications
Recently, with the arrival of Angular2 beta, I have been looking for more information about real-time applications. Currently I work with AngularJs (1.x) in the front-end with apache server in MySql…
-
2
votes2
answers118
viewsA: Problems with ng-repeat
This error happens because some value is being repeated, example a name that is similar in more than one object. To solve this, just use the track by and defined by a single value, such as $index.…
-
2
votes2
answers901
viewsA: Colorize Selected Line Angular JS and Bootstrap
A solution would be you create a variable: $scope.selected = ''; And when you click on a tr assign the $index or id of the element to this variable, then just check which value and apply the class,…
-
1
votes1
answer76
viewsA: Data array reorganization for display
At the angle, there is the property ng-repeat that will repeat a code block for each object in your array. See an example: <li ng-repeat="dados in $scope.minhaArray">{{dados.categoria_id}} -…
-
3
votes2
answers510
viewsA: Return response problem via $http.post()
Your problem, as stated in the comments, occurs because you are returning an array, but you want to use only one object (from what I understand). For this you need to make a filter, or loop. See…
-
15
votes18
answers139957
viewsA: What is the best way to center an element vertically and horizontally?
Updating the answers, since we have new methods and the compatibility is higher, we can use flexbox, which allows to achieve the result with WELL less code. See how simple it is: .classe { display:…
-
4
votes1
answer234
viewsA: My CSS file is very large and it is difficult to maintain readability
An alternative, which is the one I use, would be to use SASS. Despite having some different characteristics of css, the logic is the same, you just come to gain from using the SASS (at least that is…
-
1
votes1
answer582
viewsA: Comparing Angularjs arrays
You can use the method forEach to pass through each element of the array and inside it do the check. Example: var obj1 = [{"tipo":0,"classe":"Entrada","nome":"111","categoria":"Meu…
angularjsanswered celsomtrindade 8,038 -
1
votes2
answers4144
viewsA: How to clear input field with angular?
Try this way: $scope.form = {}; //Definido logo no inicio do controller $scope.form.msgForm.$setPristine(); //Definido no local onde deve ser feito a limpeza And in your html: <form…
angularjsanswered celsomtrindade 8,038 -
2
votes2
answers914
viewsA: What is the difference between a mixin and a Function in SASS
Both have almost the same function, as well as the @extend - despite having a output slightly more differentiated (more related to performance issues and DRY I would say). Roughly speaking, this is…
sassanswered celsomtrindade 8,038 -
1
votes2
answers1021
viewsA: Height 100% in Side-Bar
Another approach would be the use of vh instead of %. What’s the difference between them? vh vh = View Height (there is also the property vw = view width) which refers to the height of view port,…
-
2
votes1
answer528
viewsA: Value attribute of options in select are not set correctly
I don’t see why your code doesn’t work, it seems to be ok. What might be happening is getting the data wrong. Have you checked it out? When using the select you have 2 options. A traditional (as you…
-
1
votes1
answer1244
viewsA: New Project - Using Angular 1.x or Angular2 + sparkjava + material design
As I also came from good old jQuery, migrating to the AngularJs no chances of going back, before proceeding with the answer, I would like to ask a question, as it will set the course that - I at…
-
10
votes1
answer8263
viewsA: Angularjs - When should I use ng-show and when should I use ng-Hide?
Quite simply: ng-show: when you want to display content on some condition; ng-hide: when you want to hide content on some condition; Case 01: Display a div when the value of nome for Pedro <div…
angularjsanswered celsomtrindade 8,038 -
1
votes1
answer2645
viewsA: Display div according to screen resolution
.comp { display: block; } @media screen and (min-width:600px){ .comp { display:none; } } What’s going on here is this:: The div will have display:block until it reaches the minimum width of 600px;…
-
1
votes1
answer1230
viewsA: How to know what the current $Location is
If you use a route system such as the ui-router, You can do this check in many ways. But before proceeding, I must inform you that what you will be doing, if you choose this alternative, is to check…
-
0
votes1
answer39
viewsA: Custom orderby funcition
The answer is: you don’t need a orderBy customized. The orderBy accepts more than one field to be ordered, reverse or not. Example: <div ng-repeat="dados in listaArray |…
-
2
votes1
answer327
viewsA: Pick up angular-file-upload return
The response data of fileUploader are received within the plugin’s own functions, whether for success, error, progress and other methods. See the functions of callback of this page:…
angularjsanswered celsomtrindade 8,038 -
2
votes1
answer143
viewsA: CSS for A and B messages
In your code - I don’t know if it was missing css - did not work because classes start with id #jd-chat but the html does not have this definition, therefore the css is never being applied to html.…
cssanswered celsomtrindade 8,038 -
3
votes2
answers1075
viewsA: Is it bad practice to make direct paging on the front end?
I believe that you should take into consideration when designing a page would: Amount of information displayed; User’s need to consume all this information; Agility to get new results with the same…
-
1
votes2
answers253
viewsA: Does not load data into the picklist (jquery-ui + Angularjs)
How are you making a request with $http, you are expecting a response with this header: (data, status, headers, config) If you get a status positive, that is, with a valid return, the data will be…
-
1
votes1
answer3664
viewsA: change classes with Angularjs
You can use the ng-class working with condition, changing the element class. Example: <a href="" class="corCinza" ng-class="{'corAzul': !exibirForm}" ng-click="exibirForm = !exibirForm"> When…
-
1
votes2
answers189
viewsA: Always top image when receiving the Hover effect
You are misusing the class name, your css is defined as hvr-grow and its html is as hvr-grow-shadow. Just remove the -shadow of your html and everything will work. Then, to correct the problem of…
-
1
votes2
answers1403
viewsA: directive to put input fields in uppercase with Angularjs
If the sole purpose of the directive is to turn the text into uppercase, you can use a css: .uppercase { text-transform: uppercase; } CSS is lighter than Angularjs and the result will be the same.…
angularjsanswered celsomtrindade 8,038 -
2
votes1
answer933
viewsA: Convert $Scope to string in ng-model by Angularjs
Actually your problem happens because you are using a input number, this field yes accepts only values to type number, so you should use the conversion. The fields of text, for example, accept any…
-
2
votes1
answer293
viewsA: Directive is not being called, Angularjs custom validator
You have some errors in your directive statement. The AngularJS is applied by differentiating between uppercase and lowercase letters, and it is applied for each uppercase letter that you define in…
-
1
votes3
answers332
viewsA: How to make the data appear in the fields in Angularjs
As an alternative to friend @lbotinelly’s reply, when I went through a similar situation, what solved my problem was to directly apply the value to each field, this way: $scope.pegaCep = function ()…
-
3
votes2
answers1588
viewsA: How to pass input value with POST method using Angular
Try to simplify your method $http $http.post(url, data, config); //Você não está usando configurações extras, então não use o 3º parâmetro $http.post('/operacoes', model); If it still doesn’t work,…
-
0
votes1
answer1107
viewsA: Working with Factory
Well, first of all, from what I understand, your problem is in performing the second function, since it’s in another controller. Although this is possible, I will recommend that you abandon this…
-
1
votes2
answers6143
viewsA: Display float field in currency format using Filters in Angularjs
You can do the formatting directly in the view, without having to manipulate the value through a filter or directive customized. Example: $scope.meuValor = 10.3 <p>Valor: {{meuValor |…
-
2
votes3
answers19347
viewsA: How to align text to the right in a list
Your problem is not the alignment of the text itself, but the positioning of the element li within the ul. Apply the code below in the element ul: text-align: right; Thus: .top-bar ul { text-align:…
cssanswered celsomtrindade 8,038