<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ngModel לא עובד על input עם directive חיצוני]]></title><description><![CDATA[<p dir="rtl">שלום,<br />
כשאני משתמשת בdirective  על input הערך לא נכנס לי ל ngmodel.<br />
אני משתמשת ב icheck וב clockpicker.<br />
ראיתי את הבעיה שלי ב angularjs<br />
<a href="http://jsfiddle.net/tonylampada/SRBk2/1/" target="_blank" rel="noopener noreferrer nofollow ugc">link text</a></p>
<p dir="rtl">הם פתרו את זה בצורה הבאה<br />
<a href="http://jsfiddle.net/tonylampada/SRBk2/2/" target="_blank" rel="noopener noreferrer nofollow ugc">link text</a></p>
<p dir="rtl">אשמח לדעת איך עושים את זה באנגולר 4+<br />
תודה</p>
]]></description><link>https://tchumim.com/topic/7790/ngmodel-לא-עובד-על-input-עם-directive-חיצוני</link><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 11:12:30 GMT</lastBuildDate><atom:link href="https://tchumim.com/topic/7790.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 29 Jan 2020 08:38:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ngModel לא עובד על input עם directive חיצוני on Wed, 29 Jan 2020 13:20:55 GMT]]></title><description><![CDATA[<p dir="rtl">תודה<br />
עזרתם לי!</p>
]]></description><link>https://tchumim.com/post/91892</link><guid isPermaLink="true">https://tchumim.com/post/91892</guid><dc:creator><![CDATA[brachiW]]></dc:creator><pubDate>Wed, 29 Jan 2020 13:20:55 GMT</pubDate></item><item><title><![CDATA[Reply to ngModel לא עובד על input עם directive חיצוני on Wed, 29 Jan 2020 12:44:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dovid" aria-label="Profile: dovid">@<bdi>dovid</bdi></a> צודק, <a href="https://material.angular.io/components/checkbox/overview" target="_blank" rel="noopener noreferrer nofollow ugc">מטריאל מייתר לגמרי את הצורך ב icheck</a></p>
]]></description><link>https://tchumim.com/post/91878</link><guid isPermaLink="true">https://tchumim.com/post/91878</guid><dc:creator><![CDATA[יוסף בן שמעון]]></dc:creator><pubDate>Wed, 29 Jan 2020 12:44:07 GMT</pubDate></item><item><title><![CDATA[Reply to ngModel לא עובד על input עם directive חיצוני on Wed, 29 Jan 2020 11:16:25 GMT]]></title><description><![CDATA[<p dir="rtl">בא נניח לangularjs כי היא לא קשורה לבעיה.<br />
הבעיה היא גם לא השילוב של ngModel ודיירקטיב, שהם עובדים מצויין באנגולר, כפי שאפשר לראות <a href="https://stackblitz.com/edit/angular-awjcfk" target="_blank" rel="noopener noreferrer nofollow ugc">פה</a>.<br />
הבעיה היא כנראה הדיירקטיבים הספציפיים: clockpicker, icheck</p>
<p dir="rtl">מחיפוש קל באינטרנט עולה שהם דיירקטיבים של angularjs כלומר הם לא אמורים להתאים כלל לאנגולר2+ בלי כתיבת קוד מתווך.<br />
אפשר להתאים אותם, למשל לגבי הclockpicker ראי <a href="https://stackoverflow.com/q/43366449/1271037" target="_blank" rel="noopener noreferrer nofollow ugc">פה</a> הוראות הטמעה, אבל זה לא מומלץ.<br />
הכי טוב זה למצוא ספריות ייעודיות לאנגולר2+, אם את עובדת למשל עם material יש לך את זה <a href="https://agranom.github.io/ngx-material-timepicker/" target="_blank" rel="noopener noreferrer nofollow ugc">https://agranom.github.io/ngx-material-timepicker/</a></p>
]]></description><link>https://tchumim.com/post/91865</link><guid isPermaLink="true">https://tchumim.com/post/91865</guid><dc:creator><![CDATA[dovid]]></dc:creator><pubDate>Wed, 29 Jan 2020 11:16:25 GMT</pubDate></item><item><title><![CDATA[Reply to ngModel לא עובד על input עם directive חיצוני on Wed, 29 Jan 2020 11:07:12 GMT]]></title><description><![CDATA[<p dir="rtl">זה לא בגלל עצם השימוש בדיירקטיב, בינדינג עובד טוב גם עם דייקרטיב<br />
<a href="https://stackblitz.com/edit/angular-mre2hg" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackblitz.com/edit/angular-mre2hg</a><br />
הבעיה כנראה בגלל שהפלאגינים האלה משתלטים על האלמנטים המקוריים ומחליפים אותם, אז הערך לא מתעדכן למשתנה.<br />
אני לא יודע מה הפיתרון, אפשר אולי להשתמש באירועים שהפלאגין מספק כדי לעשות בינדינג ידני.<br />
דוגמא:</p>
<pre><code>export class IcheckDirective {
    @Input() data;
    constructor(el: ElementRef) {
        $(el.nativeElement).iCheck()
        .on('ifChecked', ()=&gt;this.data.select = true)
        .on('ifUnchecked', ()=&gt;this.data.select = false)
    }
}
</code></pre>
<pre><code>&lt;input type="checkbox" name="name" appIcheck [data]="user"&gt;
</code></pre>
<p dir="rtl">זו לא דרך ישרה שיבור לו המתכנת, אבל אני לא מכיר דרך אחרת.<br />
אם תמצאו דרך אחרת תעדכנו.</p>
]]></description><link>https://tchumim.com/post/91860</link><guid isPermaLink="true">https://tchumim.com/post/91860</guid><dc:creator><![CDATA[יוסף בן שמעון]]></dc:creator><pubDate>Wed, 29 Jan 2020 11:07:12 GMT</pubDate></item></channel></rss>