Declare below variables in class
highlightClass = "highlightText";
highlightRe: any;
spaceRe = /\s+/;
spaceRe2 = /\s+$/;
before: any = "";
after: any = "";
My Blog contain Phonegap,CMS related posts. Here I am posting the issues solution that I faced while development and its difficult to find proper solution on other sites. I hope my post will help you with your issues. Developer rocks.
app.controller('One', ['$scope', '$rootScope'
function($scope) {
$rootScope.$on("CallParentMethod", function(){
$scope.parentmethod();
});
$scope.parentmethod = function() {
// task
}
}
]);
app.controller('two', ['$scope', '$rootScope'
function($scope) {
$scope.childmethod = function() {
$rootScope.$emit("CallParentMethod", {});
}
}
]);
While $rootScope.$emit
is called, you can send any data as second parameter.
Solution for IONIC2+ will be up soon.Initialization of the variable to store all logs incontroller
$rootScope. = {}; timeSlots
//Function to createwith object eventname start time, end time using , ID
$scope.logEvent = function(Eventid, EventName, isEnd){if ( isEnd == false) { $rootScope. timeSlots [ Eventid] = { "name ":EventName , "startDate ": new Date( ). getTime ( ) }; }else { $rootScope. timeSlots [ Eventid] ["endDate "] = new Date( ). getTime ( ); } };Log starting time
$scope. "function1" logEvent ( , "Function1 start Time", false);
ngSrc
directive serves to properly set an image src
via Angular. As anything in Angular, it updates the image as soon as the contained Angular expression changes. However, when the ng -src
attribute is empty, Angular will not empty the src
attribute. To overcome this, use the trick below.
<img ng-src="{{ element.image || '//:0' }}" />
ngSrc
directive explicitly returns when the attribute value is false. As a workaround, set a "blank" image //: 0
serves this purpose: It adopts the current protocol, omits the hostname and sets the port to zero, which is invalid and should be killed by the network layer.src
attribute when ng -src
empties.