javascript - AngularJS not rendering in Chrome extension -
i been trying angularjs working in chrome extension, , i'm using ng-repeat function create wordlist.
here's html of chrome extension:
<!doctype html> <body> <script src="../firebase.js" ></script> <script src="../action.js" ></script> <script src="../angular.min.js"></script> <script src="browser_action.js" ></script> <style type="text/css"> #mainpopup { padding: 10px; height: 200px; width: 400px; font-family: helvetica, ubuntu, arial, sans-serif; } h1 { font-size: 2em; } </style> <div ng-app='myapp'> <div ng-controller="appcontroller"> <div ng-repeat="(f1, f2) in steps"> <p> {{f1}} : {{f2}} </p> </div> </div> </body>
here's script browser_action.js, javascript file deals chrome pop-up:
var wordthere firebank.on("value", function(snapshot){ console.log(snapshot.val()); wordthere = snapshot.val(); }) var myapp = angular.module('myapp', []); myapp.controller('appcontroller', function ($scope) { $scope.steps = wordthere; console.log("loaded"); });
the var wordthere
object list of key-value pairs retrieved firebase:
var wordthere = { "alimaniere (ali·manier·e ← manier·o)" : "differently", "la" : "the", "milito (milit·o ← milit·i)" : "war", "mizero (mizer·o)" : "misery", "reakciulo (reakci·ul·o ← reakci·o)" : "reactionary", "senfina (sen·fin·a ← fin·i)" : "everlasting", "tia" : "such, such a, kind of, sort of" };
i used jsfiddle test out angularjs part of code , seemed run fine, when packaged chrome extension pop-up doesn't display anything.
Comments
Post a Comment