Posts

Showing posts with the label Angular js

cannot find module angular http

npm install @angular/http@latest

How to use switch case in angular view

      <div ng-switch =" varible_name ">           <div ng-switch-when ="value1"><p>{{ value1}}</p></div>           <div ng-switch-when ="value2"><p>{{ value2 }}</p></div>           <div ng-switch-when ="value3"><p>{{ value3 }}</p></div>           <div ng-switch-when ="value4"><p>{{ value4}}</p></div>           <div ng-switch-default >...</div>       </div>

Get Height and Width of Image when upload

<script type="text/javascript">  var _URL = window.URL || window.webkitURL;  $('#structure_product_image').on('change', function() { //pass here file field id    var image, file;    if ((file = this.files[0])) {      image = new Image();      image.onload = function() {        $("#error_message").text("");        if (this.width <= 700) {          $("#error_message").text("Width should be greater than 700 pixel!") //id where you want to display text        }        else if (this.height <= 600){          $("#error_message").text("Height should be greater than 600 pixel!")        }        else if (this.height >= this.width){          $("#error_message").text("Height should not be greater than Width")        }        if($("#error_message").text() == ""){          $("#save_product").prop("disabled" , false)      

Make admin panel with Active admin rails || active_admin rails

Image
Make admin panel with Active admin rails || active_admin rails  Open Terminal and copy and paste this Command rails new admin_example // creating new rails application go inside the project cd admin_example run bundle install bundle install open your gem file and add this new gem's gem 'activeadmin' / / for active admin panel gem 'inherited_resources' //  making your controllers inherit all restful actions gem 'devise' // for user authentication  run bundle install again bundle install install active admin rails g active_admin:install / /install active admin to your project migrate database rake db:migrate check your seed file and run rake db:seed create user file and model rails g User name email  create post file and model rails g Post title body:text published_at:datetime user:references Now Migrate DataBase rake db:migrate start rails server rails s Hit url localhost:3000/admin/login Enter login details you can find login

What is sql definition(Structured query language). Sql Tutorial -2

Image
Structured query language It is a collection of pre defined commands and constructs with syntactical rules. 1. Sql is a client tool to interact with ORACLE DB /any DB 2. Sql is to be installed in to the system whenever we have installed the db software. 3. Client [Technical] requests should be submitted in the form of "Queries". 4. Queries are executed by SQL STMT EXECUTOR ( Oracle Db Engine ) 5. Queries are executed against database and output will be displayed on the Sql * plus window.

What is sql in Deep(Structured query language). Sql Tutorial -1

What is sql in Deep(Structured query language) Oracle was the first company to release a product that used the English-based Structured Query Language, or SQL. This language allows end users to extract information themselves, without using a systems group for every little report. Oracle’s query language has structure, just as English or any other language has structure. It has rules of grammar and syntax, but they are basically the normal rules of careful English speech and can be readily understood. What is SQL QUERIES It is known as data base language. It is used to communicate with any database. We can use this language constructs to write SQL QUERIES. What is SQL* PLUS SQL * PLUS is a default client tool and acts as an interface between client and database. What is SQL It is a collection of pre defined commands and constructs with syntactical rules

you should install 'babel-loader@7'. || babel version

If you are Getting any error in compiling main.js or app.js or in Entry file of React App You have to Update Babel versions and dependency npm install -D babel-loader @babel/core @babel/preset-env webpack And change config file options: {           presets: ['@babel/preset-env']         }

how to run rails console on other port

Open Console or Terminal When we do rails s  it will run by default on 3000 port number if you want to run on specific port then rails s -p <port-number> Hit local host on by remote address  Go to browser            And type in the url bar or search bar - 127.0.0.1:3000            If your address is like this localhost:3000 Here 3000 is a port number if you are running localhost on another port then remote address will be 127.0.0.1:<your current port number>

How do I pass an AngularJS variable into an HTML tag?

How do I pass an AngularJS variable into an HTML tag? There are three two option to pass angular variable into html. One is pass that variable into ng-modal. ex-<input type=”text” ng-modal=”angular_variable”>            2. Is pass that variable using one way binding. ex- html_tage {{angular_variable}} close_html_tag    <p>{{ name }}</p>

Angular js hidden form validation work

Angular Js  form validation   1-Create a Form                   <form name="userForm" novalidate > 2-Add Bootstrap Class for Showing Error Messages to that Div              <div class="form-group"  ng-class="  {'has-error':! userForm.email.$valid &&(!userForm.$pristine || userForm.$submitted),  'has-success':userForm.email.$valid && (!userForm.$pristine || userForm.$submitted)       }       "> replace userForm with your form name. 3-Now Add the input field into your form                 <input type="email"  name="email"  class="form-control"  ng-model="main.email"                            ng-minlength="5"  ng-maxlength="20"  required="required"> here we are adding required  validation. minimum length 5 validation . maximum length 20 validation. 4-Now Finally we add validation one by one 1-when fo

AngularJs form validation in deep

AngularJs form validation || client side validation by angular js 1-Create a Form                   <form name="userForm" novalidate > 2-Add Bootstrap Class for Showing Error Messages to that Div              <div class="form-group"  ng-class="  {'has-error':! userForm.email.$valid &&(!userForm.$pristine || userForm.$submitted),  'has-success':userForm.email.$valid && (!userForm.$pristine || userForm.$submitted)       }       "> replace userForm with your form name. 3-Now Add the input field into your form                 <input type="email"  name="email"  class="form-control"  ng-model="main.email"                            ng-minlength="5"  ng-maxlength="20"  required="required"> here we are adding required  validation. minimum length 5 validation . maximum length 20 validation. 4-Now Finally we