Error Box In Ionic - css

Is there an error box in Ionic which can be used to display messages/error with the content.
I am not looking for an alert box that pops up.
Here is an example of what I am looking for.
Personally I think that this should be part of Ionic and not have be implemented using CSS.
Thanks

There currently is no existing ionic component specified for errors.
For that, you have to customize it yourself. The error display you've shown in your example is nothing but a text field (ion-label) whose class is customized.
Here's an example:
<ion-label class="label error-label">Error Text</ion-label>
and then in a different SCSS file you would code for that class.

Related

Angular Material mat-form-field modifies styling of toolbar

Trying to create an input field in my component where I have mat-toolbar element, unfortunately inserting a mat-form-field element changes the styling of the mat-toolbar.
I was not able to diagnose where the issue is coming from (maybe if you happen to find out it will be a good idea to explain how you did), nor how to overcome it.
Here is a stackblitz minified example. To make the bug appear - uncomment line 11 in /test-comp.component.html. Link to StackBlitz.
Note: I know a simple border can be used instead of border-box class but in the full-blown app it serves a different purpose that I can not replicate with a border.
You are using mat-form-field without any form field control, and hence the issue. You can try adding any form field control and it will work. As an example, we can add <input> element along with matInput directive as:
<mat-form-field>
<input matInput placeholder="Input">
</mat-form-field>
We also would have to import appropriate module in app.module.ts:
import { MatInputModule } from '#angular/material/input';
...
imports: [
...
MatInputModule
]
I was not able to diagnose where the issue is coming from (maybe if you happen to find out it will be a good idea to explain how you did), nor how to overcome it.
I went to Stackblitz, uncommented the line and was surprised with the output. Since I haven't used Angular Material Components, I tried to investigate styles within Devtool Elements tab. I didn't saw anything wrong with the styles. I opened the console and there it was:
Error: mat-form-field must contain a MatFormFieldControl.
That gave me the clue that mat-form-field should have some kind of form control within it. I went to the docs, and found this:
This error occurs when you have not added a form field control to your form field. If your form field contains a native or <textarea> element, make sure you've added the matInput directive to it and have imported MatInputModule. Other components that can act as a form field control include <mat-select>, <mat-chip-list>, and any custom form field controls you've created.
PS: I was also able to see below warning in console. So you may need to add theme too.
Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming

How to give styles for Angular 2 primeng auto search textbox?

Hi I have implemented auto search option in Angular 2 using primeng. I have found reference in https://www.primefaces.org/primeng/#/autocomplete site. when I implement same code in my project I do not see suggestions filling in drop-down box list. I have added screenshot below.
Below is my code.
<p-autoComplete autofocus name="username" [(ngModel)]="username" [suggestions]="filteredUsernamesSingle"(completeMethod)="filterUsernameSingle($event)" field="userName" [size]="30"
placeholder="Enter UserName" [minLength]="3" required></p-autoComplete>
In reference website when user tries to search some test, everything comes in dro-down list. But when I implement I am not getting any drop-down list as I shown in above image. Can someone help me where can I add styles to make suggestions come in drop-down box list?
I had the same problem. I was passing a string[] array into [suggestions]. After examining their example it started working after I started passing an array of objects instead. Apparently the autocomplete component expects an object with a property specified in the field directive, otherwise it can't reach the value and format it properly. Try passing it an object with a userName property, since in the HTML you specified field="userName".
Check the documentation page primefaces getting started. You'll see instructions to add the primeng css and primeicons and a theme css file that you will use as the theme for your site, to the project's angular.js file. This will work like <link rel="stylesheet" href="styles.css" /> embedding of external css files to a web page.

How do you center a 'Form::file' input field in Laravel?

I'm creating a form via Laravel, and I'm running into a little issue with the Form::file() input field.
The out-of-the-box looks like the typical, basic button/file info:
But even if I try to assign it to a class with styling for all input fields, nothing seems to be affecting it. For example...
<p class="text-center">
{{ Form::file('photo', array('class'=>'form-control')) }}
</p>
...will only style the outer container of the input (not the button or text itself, and I can't seem to center it). I'm primarily using Bootstrap for my form's styles.
Am I doing something wrong that is making the file input default to its raw styling? Or is the file input type itself sort of separate from all of the other input types, needing to be customized from scratch?

AngularJS slide out menu

I am trying to create a slide out menu to no avail. I want the text (home,users) to show up upon clicking the >> button. I have run out of ideas and I am sure I am missing something very obvious. Also, this is my first crack at animations in AngularJS.
http://plnkr.co/edit/Q8UF1mPCpTAVDn59D1wV?p=preview
First off, you haven't included angular-animate.js which is required for working with animations in Angular. Second, you're using the .ng-enter/.ng-leave classes which isn't used for ng-show. You should be using .ng-hide/.ng-show classes instead. There's an example at the bottom of this page that should get you going: http://docs.angularjs.org/api/ng/directive/ngShow

Twitter Bootstrap - Can't get form to display properly

I have a form that I'm making in bootstrap but no matter what I do, I cant seem to get it to look how it looks in the tutorials. The label goes above the text box when it should be beside it, and the whole thing looks like it lacks any css formatting. Thanks for your help.
Here is the site that I'm working on and you can view the source code there:
aerofied.snbw.co/registration.php
bootstrap.min.js returns a 404 error and I believe this is the reason.
This is the URL that returns the error: http://aerofied.snbw.co/js/bootstrap.min.js
You should also read the Bootstrap documentation. You must use some specific classes for your forms.

Resources