Skip to content

Commit 430746a

Browse files
committed
Update readme for new 0.6-alpha version
1 parent b625c46 commit 430746a

File tree

1 file changed

+31
-44
lines changed

1 file changed

+31
-44
lines changed

README.md

+31-44
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
======================================================
33
> The power of Meteor and the simplicity and eco-system of AngularJS
44
5+
# New 0.6 version - biggest change we had so far!
6+
We just released angular-meteor version 0.6-alpha with a lot of many exciting features.
7+
8+
It has a completly new API for collections, templates and routing.
9+
10+
It also has breaking changes.
11+
Please read more and get ready here:
12+
13+
514
# Please support our ng-conf 2015 talk proposal by commenting on it here:
615
[https://github.com/ng-conf/submissions-2015/pull/172](https://github.com/ng-conf/submissions-2015/pull/172)
716

@@ -51,30 +60,27 @@ If you have a module called myModule, for example:
5160

5261
[More in step 0 in the tutorial](http://angularjs.meteor.com/tutorial/step_00)
5362

54-
### New Data-Binding to avoid conflict
55-
To prevent conflicts with Meteor's Blaze live templating engine, angular-meteor has changed the default AngularJS data bindings from <code>{{...}}</code> to <code>[[...]]</code>. For example:
63+
### Data-Binding
64+
From angulr-meteor version 0.6 you can use AngularJS's default delimiters and there is no need to change them.
65+
66+
All you need to do is change your AngularJS HTML template files to end with .tpl extension like - myFile.tpl
67+
68+
Then you can use it regularly, for example:
5669

5770
<div>
5871
<label>Name:</label>
5972
<input type="text" ng-model="yourName" placeholder="Enter a name here">
6073
<hr>
61-
<h1>Hello [[yourName]]!</h1>
74+
<h1>Hello {{yourName}}!</h1>
6275
</div>
6376

6477
[More in step 2 of the tutorial](http://angularjs.meteor.com/tutorial/step_02)
6578

6679
### Using Meteor Collections
6780

68-
[$collection](http://angularjs.meteor.com/api/collection)
81+
[$meteorCollection](http://angularjs.meteor.com/api/meteorCollection)
6982

70-
[$collection.bind](http://angularjs.meteor.com/api/collection-bind)
71-
72-
[$collection.bindOne](http://angularjs.meteor.com/api/collection-bindOne)
73-
74-
[AngularMeteorCollection](http://angularjs.meteor.com/api/AngularMeteorCollection)
75-
76-
77-
[More in step 6 of the tutorial](http://angularjs.meteor.com/tutorial/step_06)
83+
[More in step 3 of the tutorial](http://angularjs.meteor.com/tutorial/step_03)
7884

7985
### Subscribe
8086

@@ -83,18 +89,19 @@ To prevent conflicts with Meteor's Blaze live templating engine, angular-meteor
8389
### Adding controllers, directives, filters and services
8490
To prevent errors when minifying and obfuscating the controllers, directives, filters or services, you need to use [Dependency Injection](http://docs.angularjs.org/guide/di). For example:
8591

86-
app.controller('TodoCtrl', ['$scope', '$collection',
87-
function($scope, $collection) {
88-
$collection("todos", $scope);
92+
app.controller('TodoCtrl', ['$scope', '$meteorCollection',
93+
function($scope, $meteorCollection) {
94+
95+
$scope.todos = $meteorCollection(Todos);
8996
9097
$scope.addTodo = function() {
91-
$scope.todos.add({text:$scope.todoText, done:false});
98+
$scope.todos.push({text:$scope.todoText, done:false});
9299
$scope.todoText = '';
93100
};
94101

95102
$scope.saveTodo = function(){
96-
$scope.todos.add($scope.todos);
97-
}
103+
$scope.todos.save($scope.newTodo);
104+
};
98105
99106
$scope.remaining = function() {
100107
var count = 0;
@@ -106,43 +113,24 @@ To prevent errors when minifying and obfuscating the controllers, directives, fi
106113
107114
$scope.archive = function() {
108115
angular.forEach($scope.todos, function(todo) {
109-
if (todo.done) $scope.todos.delete(todo);
116+
if (todo.done) $scope.todos.remove(todo);
110117
});
111118
};
112119
}
113120
]);
114121

115-
### Creating and inserting template views
116-
A template is defined using the template tags (this could be in a standalone file or included in another file).
117-
118-
<template name="foo">
119-
<h1>Hello, World!</h1>
120-
</template>
121-
122-
You can render this template using handlebars as you would for any other Meteor app:
123-
124-
{{> foo}}
125-
126-
Templates will also be added to the $templateCache of the angular-meteor module. To invoke the template in AngularJS you could use ng-view and specify the template in the $templateCache when defining your routes using the $routeProvider or you could use the ng-template directive to render your template like this:
127-
128-
<ANY ng-template="foo"></ANY>
122+
### Routing
123+
There is no need anymore to use the [urigo:angular-ui-router](https://github.com/Urigo/meteor-angular-ui-router) pacage.
124+
You can just include [ui-router](https://github.com/angular-ui/ui-router) with the [meteor bower package](https://atmospherejs.com/mquandalle/bower) and in templateUrl insert the path to the tpl files.
129125

130-
<!--Add the ng-controller attribute if you want to load a controller at the same time.-->
131-
<ANY ng-template="foo" ng-controller="fooCtrl"></ANY>
132-
133-
Templates with names starting with an underscore, for example "_foo", will not be put into the $templateCache, so you will not be able to access those templates using ng-template, ng-include or ng-view.
126+
[More in step 5 of the tutorial](http://angularjs.meteor.com/tutorial/step_05)
134127

135128
### meteor-include
136129

137-
You can include Meteor native templates.
130+
You can include Meteor's native templates.
138131

139132
[meteor-include](http://angularjs.meteor.com/api/meteor-include)
140133

141-
142-
### Routing
143-
It would be wise to consider using the [urigo:angular-ui-router](https://github.com/Urigo/meteor-angular-ui-router) Meteor package for angular-meteor, which exposes the popular [ui-router](https://github.com/angular-ui/ui-router) module to angular-meteor. For those of you that have grown accustomed to the Meteor methods of routing, angular-meteor is compatible with [Iron Router](https://github.com/EventedMind/iron-router).
144-
145-
[More in step 5 of the tutorial](http://angularjs.meteor.com/tutorial/step_05)
146134

147135
### User
148136

@@ -162,7 +150,6 @@ It would be wise to consider using the [urigo:angular-ui-router](https://github.
162150

163151
Using this method, additional functionality has been provided to urigo:angular-meteor in the form of separate Meteor packages that expose and inject angular modules into angular-meteor. These packages have been developed by either the angular-meteor Team and/or by third parties. The following is a non-exhaustive list of these packages:
164152

165-
- [urigo:angular-ui-router](https://github.com/Urigo/meteor-angular-ui-router) empowers angular-meteor with the [ui-router](https://github.com/angular-ui/ui-router) module.
166153
- [urigo:ionic](https://github.com/Urigo/meteor-ionic) [Ionic Framework](http://ionicframework.com/) on top of Meteor.
167154
- [netanelgilad:angular-file-upload](https://github.com/netanelgilad/meteor-angular-file-upload) empowers angular-meteor with [angular-file-upload](https://github.com/nervgh/angular-file-upload) module.
168155
- [davidyaha:smart-table](https://github.com/davidyaha/meteor-smart-table) empowers angular-meteor with [smart-table](https://github.com/lorenzofox3/Smart-Table) module.

0 commit comments

Comments
 (0)