Ziel: Entwicklung von
https://bitbucket.org/MarkusKramer/polymer-demo
Text
Unterschiede:
<dom-module name="hello-world">
<style>
p {
color: red;
}
</style>
<template>
<img src="icon.jpg" />
<p>[[text]]</p>
</template>
<script>
Polymer({
is: "hello-world",
ready: function() {
this.text = "Hello World"
}
})
</script>
</dom-module>
ngModule.directive('hello-world', [function() {
return {
restrict: 'E',
templateUrl: 'complete/path/to/hello-world.html',
scope: {
},
controller: ['$scope', function($scope) {
$scope.text = "Hello World"
}]
}
}]);
<img src="complete/path/to/icon.jpg" />
<p class="hello-world-paragraph">{{text}}</p>
p.hello-world-paragraph {
color: red;
}
mk@markus-kramer.de
http://www.xing.com/profile/Markus_Kramer7