This might be a simple angular filter, but more helpful to reduce ugly code in your controller. Angular provides '$interpolate' service to evaluate angular expressions. Consider you have some constant template with some expression expecting a dynamic value - lets say userName. Example: //example.js angular.module('app.example',[]) .constant('TEMPLATE',{ WELCOME_MSG: 'Hi {{userName}} Welcome to our Portal' }) .controller('sampleCtrl', function($scope, TEMPLATE, $interpolate){ $scope.data = { userName:'Ajai' }; $scope.MSG = $interpolate(TEMPLATE.WELCOME_MSG)($scope.data); }); <!--example.html--> <div ng-app="app.example" ng-controller="sampleCtrl"> <h1>{{MSG}}</h1> </div> Instead you can simplify the above one with custom interpolate filter. Below example wont make much difference, but consider if you have some 100 template constants - ...
Javascript tips and tricks, JQuery tips & tricks, JQuery Plugins, CSS Tricks and Tips, things you may not know about javascript, AngularJS tips and tricks, Laravel, PHP tips and tricks, computer programming, grapical user interface using c, c header files, computer graphics lab program, 2d translation, 3d translation, line drawing algorithm, circle drawing algorithm, DDA, Midpoint, 3D projection using c, Personal diary, Mini project using c, Graphical User Interface using C