Skip to main content

Posts

Showing posts with the label $scope vs scope in angularjs

Angular 4 is coming soon!!! Did you know about Angular 2?

Rob Wormald , developer and Angular core team member at Google . He told InfoWorld that Angular 4 will be released in March 2017 . Angular 4  will have better tooling and will generate less code; Google also is promising a new major version twice a year. Key features of Angular 2, 1.       Angular 2 is faster and easier than Angular 1. 2.       Angular 2 is mainly focused on mobile apps. 3.       It supports latest the version of browsers and also supports old browsers including android 4.1+. 4.       It is a cross platform framework. 5.       Code structure is very simplified than the previous version of Angular. Why Angular 2? 1.       The Angular 2 has better performance. 2.       The Angular 2 has more powerful template system. 3.       The An...

JavaScript/jQuery Special Characters Validation example

Hello everyone, I am going to share the special characters validation using JavaScript/jQuery. The input special characters   !@#$%^&*()_+~{}[]';:"/.,< >? Example as given below $( function () {    $( "form :input[type='text']" ).on( "keyup" , function (e) {         var inputTextId = $( '#' + this .id);         var inputText = inputTextId.val();         var errorFor = this .id ;         if (!isValidChar(inputText)) {             $( '#' + this .id).val( '' ).valid();                     setTimeout( function () { replaceErrorMsg(errorFor); }, 100);         }      });   });   fu...

What about ng-Cloak directive in AngularJs?

Hello everyone, Today I am going to share the interesting articles about ng-cloak directive . 1. What is ng-cloak directive? 2. Why we use it? The ng-cloak directive are use to prevent the un-compiled elements from being displayed and un-compiled elements can be an element that hold and wait for incoming data. i.e. < div ng-cloack>{{ myCloackVar }}</ div > <div ng-cloack>{{ myCloackVar }}</div> If myCloackVar controller is not compiled or the myCloackVar data is not populated in ng-cloak prevent {{ myCloackVar }} from being displayed and display only the HTML div when the myCloackVar variable is compiled. I am going to share the example code sample with ng-cloak and without ng-cloak as given below. Click for live Plnkr Demo <!DOCTYPE html> <html> <head>    <link rel= "stylesheet" href= " http://getbootstrap.com/2.3.2/assets/css/bootstrap.css " >    <style> ...

$scope vs scope in angularjs

This is interesting question and little bit confusion about $scope and scope and how to differentiate to in controller and directive both case in Angularjs. In the case of controller, When you are using $scope in controller.  The injection inject scope based on matching valuable name ( $scope ). In case when we using scope as name its not work. The code look like. {{         app.controller( "MyController" , [ '$scope' , '$http' , function (i, j) {               console.log( "$scope : " + i);               console.log( "scope : " + j);           }         ]); }} In the case of directive, Injection work position based. So you take your name anything like i, j etc. Just you can say look like scope, ele...

7 Best Tutorials with live Examples [Angular 1 & Angular 2]

Use below links and explore in details to read Angular 1, Angular 2 and Interview Questions and Answers and also e- learning book & notes..! Angular 1.x Tutorial and Examples Angular 2 Tutorial and Examples Angular 1.x Interview Questions and Answers Angular 2 Interview Questions and Answers E-Book for Angular 1 with live Examples                                                                                                       JavaScript Interview Questions and Answers I hope you are enjoying with this post! Please share with you friends!! Thank you!!!