Powered by Blogger.

Sunday, 11 January 2015

Angularjs

By Unknown  |  23:57 No comments

How to reverse string in angular js

<div ng-controller="secondController">
        <input type="text" ng-model="data.message">
        <h1>{{data.message | toCaps | reverse }}</h1>
</div>
Update to UPPERCASE
myApp.filter('toCaps',function () {
    return function (msg) {
        return msg.toUpperCase();
    }
});
UPDATE to reverse
myApp.filter('reverse',function () {
    return function (msg) {
        return msg.split("").reverse().join("");
    }
});


Anonymous Author: Unknown

Hello, I am Author, decode to know more: In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet.

Related Posts

0 comments:

Recent Articles

© 2014 Learning Java. WP themonic converted by Bloggertheme9. Published By Gooyaabi Templates