3.0.8 • Published 1 year ago

ember-cli-mdc-layout v3.0.8

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
1 year ago

ember-cli-mdc-layout

ember-cli support addon for layout-based logic

Installation

ember install ember-cli-mdc-layout

Services

This package contains the following services.

Layout Service

The layout service is used to query information about the current device layout. Its primary purpose is to support device-specific layouts in template definitions. The layout service has the following properties:

  • isPhone - Test if the current layout is for a phone
  • isTablet - Test if current layout is for a tablet
  • isDesktop - Test if the current layout is for a desktop

Usage

You use the layout service by injecting it into either a controller or component. Here is a controller were we inject the layout service.

// controllers/index.js

import Controller from '@ember/controller';
import { inject as service } from '@ember/service';

export default Controller.extend ({
  layout: service ()
});

We can then use the layout service to add conditional blocks based on different device layouts.

// templates/index.js
<div>We are now viewing this applicaiton on a 
  {{#if layout.isPhone}}
  phone.
  {{else if layout.isTablet}}
  tablet.
  {{else if layout.isDesktop}}
  desktop.
  {{/if}}
</div>
3.0.8

1 year ago

3.0.0

1 year ago

3.0.0-alpha.21

3 years ago

3.0.0-alpha.20

3 years ago

2.8.5

3 years ago

2.0.19

4 years ago

2.0.12

4 years ago

2.0.11

4 years ago

2.0.10

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.0-octane.49

4 years ago

2.0.0

4 years ago

2.0.0-octane.48

4 years ago

2.0.0-octane.47

4 years ago

2.0.0-octane.46

4 years ago

2.0.0-octane.45

4 years ago

2.0.0-octane.43

4 years ago

2.0.0-octane.39

5 years ago

2.0.0-octane.42

5 years ago

2.0.0-octane.41

5 years ago

2.0.0-octane.40

5 years ago

2.0.0-octane.38

5 years ago

2.0.0-octane.37

5 years ago

2.0.0-octane.35

5 years ago

2.0.0-octane.36

5 years ago

2.0.0-octane.34

5 years ago

2.0.0-octane.33

5 years ago

2.0.0-octane.32

5 years ago

2.0.0-octane.31

5 years ago

2.0.0-octane.30

5 years ago

2.0.0-octane.28

5 years ago

2.0.0-octane.27

5 years ago

2.0.0-octane.26

5 years ago

2.0.0-octane.24

5 years ago

2.0.0-octane.23

5 years ago

2.0.0-octane.25

5 years ago

2.0.0-octane.22

5 years ago

2.0.0-octane.17

5 years ago

2.0.0-octane.19

5 years ago

2.0.0-octane.18

5 years ago

2.0.0-octane.21

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.8

5 years ago

2.0.0-octane.16

5 years ago

2.0.0-octane.15

5 years ago

2.0.0-octane.14

5 years ago

2.0.0-octane.13

5 years ago

2.0.0-octane.12

5 years ago

2.0.0-octane.11

5 years ago

2.0.0-octane.10

5 years ago

2.0.0-octane.9

5 years ago

2.0.0-octane.8

5 years ago

2.0.0-octane.7

5 years ago

2.0.0-octane.6

5 years ago

2.0.0-octane.5

5 years ago

2.0.0-octane.4

5 years ago

2.0.0-octane.3

5 years ago

1.0.0

5 years ago

1.0.0-alpha.0

6 years ago

0.80.4

6 years ago

0.80.0

6 years ago

0.79.0

6 years ago

0.78.2

6 years ago

0.78.1

6 years ago

0.76.0

6 years ago

0.75.0

6 years ago

0.74.8

6 years ago

0.74.0

6 years ago

0.73.0

6 years ago

0.72.0

6 years ago

0.71.0

6 years ago

0.70.2

7 years ago

0.70.0

7 years ago

0.69.0

7 years ago

0.68.0

7 years ago

0.67.0

7 years ago

0.66.0

7 years ago

0.65.0

7 years ago