[Vue warn]: Cannot find element

I’m using Vuejs. This is my markup: <body> <div id=”main”> <div id=”mainActivity” v-component=”{{currentActivity}}” class=”activity”></div> </div> </body> This is my code: var main = new Vue({ el: ‘#main’, data: { currentActivity: ‘home’ } }) ; When I load the page I get this warning: [Vue warn]: Cannot find element: #main What am I doing wrong? 6 … Read more

Add directives from directive in AngularJS

I’m trying to build a directive that takes care of adding more directives to the element it is declared on. For example, I want to build a directive that takes care of adding datepicker, datepicker-language and ng-required=”true”. If I try to add those attributes and then use $compile I obviously generate an infinite loop, so … Read more

Binding a WPF ComboBox to a custom list

I have a ComboBox that doesn’t seem to update the SelectedItem/SelectedValue. The ComboBox ItemsSource is bound to a property on a ViewModel class that lists a bunch of RAS phonebook entries as a CollectionView. Then I’ve bound (at separate times) both the SelectedItem or SelectedValue to another property of the ViewModel. I have added a … Read more

AndroidViewModel vs ViewModel

With the introduction of the Android Architecture Components library, several new classes were introduced, including AndroidViewModel and ViewModel. However, I’m having trouble figuring out the difference between these two classes. The documentation succinctly describes AndroidViewModel as follows: Application context aware ViewModel I appreciate the brevity, but what exactly does this imply? When should we choose … Read more

What is difference between MVC, MVP & MVVM design pattern in terms of coding c#

If we search Google using the phrase “differences between MVC, MVP & MVVM design pattern” then we may get a few URL’s which discuss the difference between MVC MVP & MVVM design pattern theoretically like: MVP Use in situations where binding via a “dataContext” is not possible. Windows Forms is a perfect example of this. … Read more

MVVM: Tutorial from start to finish?

Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I’m a C#/Windows Forms programmer with more than 5 years experience. I’ve been investigating WPF using the MVVM (Model-View-ViewModel) design pattern. I have searched the Internet for tutorials. I … Read more

Data binding to SelectedItem in a WPF Treeview

How can I retrieve the item that is selected in a WPF-treeview? I want to do this in XAML, because I want to bind it. You might think that it is SelectedItem but apparently that does not exist is readonly and therefore unusable. This is what I want to do: <TreeView ItemsSource=”{Binding Path=Model.Clusters}” ItemTemplate=”{StaticResource ClusterTemplate}” … Read more