Hidden time for angular-bootstrap-calendar - angularjs

Here is a pretty clean and easy to use calendar made in Angularjs.
https://github.com/mattlewis92/angular-bootstrap-calendar#documentation
For now, the events always have time, but I don't want to use it. How to hidden it?

I think you can custom it via:
calendarConfig.templates.templateView
https://github.com/mattlewis92/angular-bootstrap-calendar#configuring-the-calendar-default-config

Related

How can we detect when the model is back to its original value?

JS Bin here
This article describes a clever way to see if your (pure Angular) form model has changed since the initial load. In my mind it's a more accurate test of $dirty/$pristine. This allows us to do things like hide the "Save" button for a form if the model hasn't changed, even if the user has typed then deleted text.
So the question is, how can we do this with angular-formly? My hunch is that onChange for each field might be a good starting point, but I'm having a lot of trouble putting together the rest of the solution.
Hope the question makes sense. Any ideas would be very welcome. Thanks!
This might work in a limited capacity:
scope.initialValue;
var listener = scope.$watch(function(oldVal,newVal){
scope.initialValue = oldVal
listener();
})
atinder was correct in that the pure Angular approach actually works fine with angular-formly. I've created a working JS Bin here.

Making an angular statusbar directive

im looking to implement a directive to display status messages in my ionic angular app.. the idea is that i define a bunch of standard status messages in my template as follows and it's inspired by the stock ng-switch directive..
<status-bar code="statusCode" onShow="onStatusShow" onHide="onStatusHide">
<status-message when-code="OK" style="calm" timeout="3000">My HTML message</status-message>
...
...
<status-message when-complex style-field="style" text-field="text" timeout-field="timeout" />
</status-bar>
my requirements are these:
status-bar
the directive should bind to $scope.statusCode and depending upon its string value, it should activate one of the sub-directives except the when-complex one..
however, if i assign an object to $scope.statusCode, it should activate the when-complex directive if defined..
the directive also exposes an onShow and onHide callbacks..
when changing the value of $scope.statusCode, the previously active sub-directive should be completely hidden before showing the newly active one.. (animations)
status-message
style and timeout attributes are optional and will default to 'stable' and null respectively..
the timeout attribute will cause this sub-directive to show for a short time before clearing $scope.statusCode..
whereas i can write very simple directives, this one is proving to be a bit beyond me.. ive seen the source of ng-switch and its confusing.. i have tried myself as well but i havent gotten really far with this no matter how much ive tried.. im not posting my code approaches here not for the lack of trying but for the sake of cluttering and relevance..
so i was wondering if maybe someone could come up with a possible basic approach on codepen or plunkr that i can use as a base for expanding upon (since this is just a simplified explanation of what i intend to do with this directive).. or atleast point in the directions i need to go in..
after a night of brain-storming and coding punctuated by coffee and smoke breaks.. ive managed to make it work.. once again keeping ng-switch as a base.. the code is a bit long.. and i changed a few requirements along the way for better usability.. and some requirements like #2 and #3 dont work yet.. but im pretty sure ill make it work as well..
so if anybody is having a similar issue or is interested in my solution.. i can post it here.. :)

AngularJS: how to undo any last change in the document

Is it possible to use $watch in order to create an undo functionality which I could use to undo any last change in the view?
For example, I have multiple input fields, ng-includes on demand etc - what would be the easiest and most efficient way of implementing Undo functionality?
I was thinking about pushing any change on the view to an array, and in case of undoing() simply deleting the last item from that array and serving the array again, though not sure if there is another, better way of doing that in angular. Any tips?
You could use the LazyJsonUndoRedo:
https://github.com/azazdeaz/LazyJsonUndoRedo
http://dailyjs.com/2014/07/18/lazy-json-undo/
From the readme:
A 'drop in' history handler with automatic undo/redo functionality for nested javascript objects, using ES6 Object.observe() or Polymer shim.

Cakephp custom URL using Route

I would like to format my URL like so:
/teacher/page:2
to
/teacher
I would like to achieve this result by using as less code as possible (perhaps only from routes.php?), without modifying how the PaginatorHelper behaves.
Thank you for your help!
You can accomplish this with:
ajax
form posts instead of gets (requires altering the pagination
helper)
But I would advise against it. This is designed for good usability. If you change it, It will make your site less user friendly than you may want it to be. I know I would be frustrated trying to jump to a specific page only to find out I have to click my way to page 35. Yuck!

tracking affiliates in mixpanel

Trying to use mixpanel to set up a basic affiliate tracking system.
No problem setting up referral links and tracking events through the segmentation system, however I want to be able to attribute a certain event to a refferer even if the event is triggered in a later session (e.g the classic 30 day cookie for a standard affiliate program).
Anyone know how to go about doing this?
Thanks
It sounds like you want a super property.
Building on raylu's answer you certainly want a super property: How do I set a property every time?
For affiliates you likely want to only count the first affiliate so you want to use register_once: https://mixpanel.com/docs/integration-libraries/javascript-full-api#register_once

Resources