You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's it, now we can use angular-material in our application layout.
21
+
Don't forget to remove the `ui.bootstrap` dependency! It's not longer needed!
22
22
23
-
Angular-material uses declarative syntax, i.e. directives, to utilize Material Design elements in HTML documents.
23
+
That's it, now we can use angular-material in our application layout.
24
24
25
-
First we want to change our `index.html` to make use of the flex grid layout provided by Material Design. So, change your `client/index.html` to look like this:
25
+
Our application will have some errors now because we used to use services like `$modal` that belong to bootstrap's core.
26
+
27
+
So first, let's fix is by using `$mdDialog` instead of `$modal`:
Great! So now in order get rid of all the bootstrap change we make, we need to remove some and modify some CSS and LESS.
36
+
I did that [in this commit](), and this is not part of the tutorial because the CSS is just copy-and-paste piece of code.
37
+
Note that most of the change in this commit includes deleting CSS rules that used to override the Bootstrap's design.
38
+
39
+
Angular-material uses declarative syntax, i.e. directives, to utilize Material Design elements in HTML documents.
40
+
41
+
First we want to change our `index.html` to make use of the flex grid layout provided by Material Design. So, change your `client/index.html` to look like this:
You can see we use `layout="column"` in the `body` tag, which tells angular-material to lay all inner tags of `body` vertically.
30
46
31
47
Next, we use the handy `md-toolbar` directive as a wrapper for our app's toolbar.
@@ -43,27 +59,28 @@ element which is actually a separator blank element which is used to fill all th
43
59
So, now we have a link to Parties to the left, a span to fill all space, and a login button.
44
60
Element layout flex grid is very simple and intuitive in angular-material and you can read all about it [here](https://material.angularjs.org/#/layout/grid).
45
61
46
-
Next, we need to convert our parties list and party detail views to angular-material.
62
+
Next, we need to convert our parties list and party detail views to angular-material.
47
63
First, replace the code in your `client/views/parties-list.ng.html` with this code:
First thing of note here is that we're using `controllerAs` parameter in the route definition. This gives an alias to `$scope` and many other benefits. For detailed information, read [this article](http://toddmotto.com/digging-into-angulars-controller-as-syntax/). You will see later how we use it.
@@ -119,7 +140,7 @@ So, let's go ahead and create them. Create a subfolder `users` in the `client/`
119
140
120
141
Create a file `client/users/controllers/login.js`. Paste the following code:
In our router file, we declared the login route controller to be `LoginCtrl` and a `controllerAs` parameter to be `lc`.
143
164
@@ -146,21 +167,21 @@ So to address all variables/objects/methods of our controller, we prefix them wi
146
167
147
168
In our view. You can see in the view that we use `lc.error`, `lc.credentials`, and `lc.login()`.
148
169
149
-
The procedure is the same for the `register` and `resetpw` routes, so now you create `client/users/controllers/register.js` and paste following code into it:
170
+
The procedure is the same for the `register` and `resetpw` routes, so now you create `client/users/controllers/register.js` and paste following code into it:
0 commit comments