Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Integration of Framework7 with Angular Js - Try ithttp://ashvin777.github.io/framework7.angular/kitchen-sink-material/#!/home.html

NotificationsYou must be signed in to change notification settings

ashvin777/framework7.angular

Repository files navigation

Join the chat at https://gitter.im/ashvin777/framework7.angular

Full Featured Mobile HTML Framework For Building iOS & Android Apps with the Power of AngularJS.

Anuglar 2 Integration (UNDER DEVELOPMENT)

https://github.com/ashvin777/framework7.angular2

Full Documentation

https://github.com/ashvin777/framework7.angular/

Kitchen Sink App

http://ashvin777.github.io/framework7.angular/kitchen-sink-material/#!/home.html

Demo App

http://ashvin777.github.io/framework7.angular/examples/#!/home.html

Install

From Bower

bowerinstallframework7.angular

From NPM

npminstallframework7.angular
<scripttype="text/javascript"src="../build/js/framework7.js"></script><!-- Framework7 Hook for AngularJS --><scripttype="text/javascript"src="bower_components/framework7.angular/dist/framework7.angular.hook.js"></script><scripttype="text/javascript"src="js/index.js"></script>

Then initialize the application by setting angular:true and pushState:true in options

varmyApp={};varmainView={};var$$=Dom7;angular.module("AngularApp",[]).run(function(){myApp=newFramework7({modalTitle:'Framework7',material:true,pushState:true,//set it true. It will enable the hash based navigationangular:true//set it to true to enable angular binding in Framework pages});mainView=myApp.addView('.view-main',{});})

After this setup, you can define the controller, directives, services, factories or provider as per your requirement. The code structure will remain same as Framework7 standard app.

Screenshots

Routing - WIP

For now use Framework7 default routerhttp://framework7.io/docs/router-api.html

Controller

Controller can be directly assgined to the template root element. By doing so while the Framework7 will initialize the page then AngularJS hooks compiler will compile the template and bind the data based on the scrope of the controller.

So you html template should look like this

<divdata-page="calendar"class="page"ng-controller="CalendarCtrl">...    ...</div>

Framework7 Template

The templates of side panels, popover, modals etc, wrap them in a element directive and add that directive in html. Like below

Side Panel

<bodyng-controller="RootCtrl"ng-cloak>    ...<panel-left></panel-left><panel-right></panel-right>    ...</body>

Directive

app.directive("panelLeft",function(){return{templateUrl:"panel-left.html"}});app.directive("panelRight",function(){return{templateUrl:"panel-right.html"}});

And defind a controller in the root element of the panels template and use it as required.

Using Framework7 Components

Framework7 components can be used as it is. Inside the controller those can be initialize like below

...controller("CalendarCtrl",["$scope",function($scope){....varcalendarDefault=myApp.calendar({input:'#ks-calendar-default',});    ....}]);

To avoid issues

Use ng-cloak for each controller declaration in html templates.

Limitation

No limitation

Contact

ashvin.suthar777@gmail.com

Licence

No License is required for this plugin.


[8]ページ先頭

©2009-2025 Movatter.jp