Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Kendo date picker k-start, k-depth not working. #203

Open
ansarizafar opened this issue Feb 17, 2014 · 6 comments
Open

Kendo date picker k-start, k-depth not working. #203

ansarizafar opened this issue Feb 17, 2014 · 6 comments

Comments

@ansarizafar
Copy link

I am trying to use k-start and k-depth properties with date picker like this

input kendo-date-picker k-depth="'year'" k-start="'year'" id="dtcertdate" ng-model="certificate.date"

but its not working.

@mishoo
Copy link
Contributor

mishoo commented Feb 17, 2014

It appears to be an Angular bug “feature”. :-( Any directives that end in -start or -end are interpreted specially (and the start / end suffixes are dropped from the attribute names).

“This was broken in 1.2. It's best to rename the attributes to something else and move on.”

I do have a crazy workaround for you: use k-start-start (works because Angular drops only the last -start). Or, pass k-options and specify the start option there.

I'm not even sure what's the best way to fix. Angular recommends renaming, but I don't like this idea.

// cc @burkeholland @akorchev Guys, what do you think?

@akorchev
Copy link
Contributor

If this is a "feature" so be it - k-start-start it is. The other way also ain't bad - k-options

@mishoo
Copy link
Contributor

mishoo commented Feb 17, 2014

Yeah, k-start-start wouldn't be too bad, but what I'm afraid of is that this could trigger random “magic” in Angular if it finds a matching -end (and not the good kind of magic). The commit that added this “feature” looks scary.

Oh well. Frameworks.

burkeholland referenced this issue in angular/angular.js Feb 17, 2014
By appending  directive-start and directive-end to a
directive it is now possible to have the directive
act on a group of elements.

It is now possible to iterate over multiple elements like so:

<table>
  <tr ng-repeat-start="item in list">I get repeated</tr>
  <tr ng-repeat-end>I also get repeated</tr>
</table>
@burkeholland
Copy link
Contributor

Let's see if there is a way to globally override that. I don't like the thought of having attributes that you can't use even when they are custom. That seems heavy handed.

In the meantime, it sounds like the only option for the attribute is to use k-start-start or some derivative like k-start-x. Ugly.

@mishoo
Copy link
Contributor

mishoo commented Feb 17, 2014

@burkeholland
Copy link
Contributor

There's the PR to fix this. In the meantime, I think options is the best way to go.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants