Google Groups

Re: AngularJS 1.0.0rc7 rc-generation released!


Charlie May 1, 2012 8:28 AM
Posted in group: AngularJS
This works great when the controller is assigned declaratively.
What is the syntax for using $routeProvider?

$routeProvider.when('/test', {template: 'partials/test.html',
controller: MyCtrl});

The above results in "Uncaught ReferenceError: iframeCtrl is not
defined from myApp"

On May 1, 2:07 am, Igor Minar <i...@angularjs.org> wrote:
> Either works. I would suggest to use the module for "serious" apps. This is
> one of the things I want to change in the tutorial in the next few days.
>
> /i
>
> On Mon, Apr 30, 2012 at 10:39 PM, Brendan Owen <brendan.o...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Great work guys.
>
> > I just have a query about how the controller is done.
>
> > I noticed here and a few other places the controller is not done with a
> > the angular.module function
>
> > var myApp = angular.module('myApp',[]);
> > function MyCtrl($scope) {
> >     $scope.name = 'Superhero';
> > }
>
> >http://jsfiddle.net/**IgorMinar/CHVbb/499/<http://jsfiddle.net/IgorMinar/CHVbb/499/>
>
> > I would have thought that version 1.0.0rc? defined the controller using
> > the angular.module function like below
>
> > var myApp = angular.module('myApp',[]);
> > myApp.controller('MyCtrl', ['$scope', function ($scope) {
> >     $scope.name = 'Superhero';
> > }])
>
> >http://jsfiddle.net/brendanowen/qfJde/2/
>
> > Is it better practice defining the controller using the angular.module
> > function or without?
>
> > Are the examples just throw backs from the previous version of Angular?
>
> > Regards
> > Brendan
>
> > On Tuesday, May 1, 2012 9:35:33 AM UTC+10, Igor Minar wrote:
>
> >> Hi there!
>
> >> We are happy to announce that we released AngularJS 1.0.0rc7
> >> rc-generation!
>
> >> The tutorial updated for 1.0 is here! Please check it out and report bugs
> >> and typos. I still have few adjustments planned, but for the most part
> >> people can start learning from it.
>
> >> You can find complete release notes for 1.0.0rc7 at:
>
> >>https://github.com/angular/**angular.js/blob/master/**
> >> CHANGELOG.md#1.0.0rc7<https://github.com/angular/angular.js/blob/master/CHANGELOG.md#1.0.0rc7>
>
> >> You can grab the latest bits from:
>
> >>http://code.angularjs.org/1.0.**0rc7/angular-1.0.0rc7.tgz<http://code.angularjs.org/1.0.0rc7/angular-1.0.0rc7.tgz>
> >>http://code.angularjs.org/**angular-1.0.0rc7.js<http://code.angularjs.org/angular-1.0.0rc7.js>
> >>http://code.angularjs.org/**angular-1.0.0rc7.min.js<http://code.angularjs.org/angular-1.0.0rc7.min.js>
>
> >> The docs can be found at:http://docs.angularjs.org/**(that's right!
> >> docs-next is no more).
>
> >> The angular-seed project has been updated as well:https://github.com/**
> >> angular/angular-seed <https://github.com/angular/angular-seed>
>
> >> Please keep the bug reports coming! Your jsfiddles and emails with
> >> various issues were very helpful in weeding out all kinds of obscure bugs.
> >> To quickly start fiddling, please use this template:http://jsfiddle.net/
> >> **IgorMinar/CHVbb/499/ <http://jsfiddle.net/IgorMinar/CHVbb/499/>
>
> >> Cheers,
> >> the AngularJS gang
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "AngularJS" group.
> > To view this discussion on the web visit
> >https://groups.google.com/d/msg/angular/-/NBGfTKBYlYsJ.
>
> > To post to this group, send email to ang...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > angular+u...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/angular?hl=en.