Binding problem

28 views
Skip to first unread message

Bogdan Ionescu

unread,
Oct 21, 2014, 10:59:04 AM10/21/14
to ang...@googlegroups.com
Hi,
I just start to use angularJS.
I want to create a tabControl.
Here is my code: Plunker

Any help is welcome.

Adrian Lynch

unread,
Oct 21, 2014, 11:19:47 AM10/21/14
to ang...@googlegroups.com
Typo in your markup:

<h1>{{curentTab.title}}</h1>
<p>{{curentTab.content}}</p>

curentTab is missing an R.

Adrian

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Bogdan Ionescu

unread,
Oct 21, 2014, 11:21:54 AM10/21/14
to angular
Whow :-).
Thanks

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/7PIJ0QamtWY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.

To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Bogdan Mihai Ionescu


Bogdan Ionescu

unread,
Oct 21, 2014, 11:24:04 AM10/21/14
to ang...@googlegroups.com
That mean was typing problem: not binding problem ....

Adrian Lynch

unread,
Oct 21, 2014, 11:31:56 AM10/21/14
to ang...@googlegroups.com
No problem. I'm just getting into Angular so these problems are fun!

You could change this:

$scope.currentTab = $scope.tabs[0];
$scope.currentTitle = $scope.tabs[0].title;
$scope.onClickTab = function(tab) {
$scope.currentTab = tab;
$scope.currentTitle = tab.title;
};

To this:

$scope.onClickTab = function(tab) {
$scope.currentTab = tab;
};

$scope.onClickTab($scope.tabs[0]);

$scope.currentTitle doesn't seem to be used and you can just call onClickTab, passing the first tab, to set the defaults.

Adrian

On 21 October 2014 16:24, Bogdan Ionescu <bogda...@gmail.com> wrote:
That mean was typing problem: not binding problem ....

Bogdan Ionescu

unread,
Oct 21, 2014, 11:34:55 AM10/21/14
to angular
Thanks, I'll already did this :-).

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/7PIJ0QamtWY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.

To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Bogdan Mihai Ionescu


Reply all
Reply to author
Forward
0 new messages