last day (14 days later) » 

1:46 PM
2
A: Wrap Angular App in a jQuery function

Lowe BäckströmLong time since I used it but this should work. It's a manual bootstrap of Angular so no ng-app in your index file. (function () { $(document).ready(function () { if (TT) { TT.native.init().done(function () { angular.bootstrap(document, ['myTickTailApp']);...

 
Thanks! Would I place the entire Angular app inside the function appStart? or just that first line? where do I place the rest of the code then? Is it possible to keep the structure of the Tictail code as in my example? There is a possibility they will not approve the app otherwise.
 
Put up some code on Github you might be able to use, or look at to get an idea: github.com/lowebackstrom/tictail-angular-boilerplate
 
Brilliant! Thanks a lot. Very useful! Do I simply need the whole package or what code is needed for a fully functional native app, with authorization and so on?
 
Happy to help! The whole package gives you authorization and persistence of user data on your own backend. The server part is not necessary but removing it means rewriting some of the handshake logic in app.js. You do need mongodb and redis running on your local machine to run. When in production I used Heroku for both native and server. While developing put in localhost:9000 as URL for your app in TicTail and "run secure code" when starting through TT dev.
 
Okay thanks. We are running MSSQL and .NET so maybe I have to find a slightly other way. Any guidance on which parts that could be useful?
 
1:46 PM
Use the "/native" part as your app and connect it to your own backend. The whole logic for sessions (login/registration) is in app.js. Apart from that you need to reconfigure Restangular to talk to your API instead of the "/server" one in the repo. But as I said, if you don't need to do stuff in the backend, persist products or custom data, it is not required to make the app work. You can handle sessions straight through Angular.
 
I am a newbie to Angular so this is a bit overwhelming I must admit :) what does ngTictail do?
 
Moved to chat
 
good idea. I appreciate your help. förresten, nu är det väl inte en publik diskussion så då kan ju svenska gå för sig
 
ngTicTail is an Angular wrapper for the tt.js api. You might have noticed that it's not straight forward to run 3rd party code (like jQuery) directly inside of Angular).It is not finished and need some more work.
Haha
Ja det är kanske lättare :)
 
:)
okej. jag är som sagt ny på Angular, har endast jobbat en del med jQuery i .net-miljö tidigare. så hela sättet att utveckla är väldigt annorlunda. jag försöker liksom wrap my head around it :)
 
1:50 PM
Det kan verkar lite avancerat men jag rekommenderar att bygga ditt eget från scratch och titta på min kod för inspiration.
 
jo det var min tanke för att verkligen förstå hela tiden vad man pysslar med, annars kan det ju lite bli körigt längre fram
 
Angular är ganska annorlunda jämfört med JS i allmänhet. Tar lite tid att fatta grejen. Har skrivit JavaScript i typ 6 år och är fortfarande förvirrad av Angular ibland.
Precis
 
ja, men du är uppenbarligen mer av en coder än vad jag är. du har ganska många angular assets. behövs touch osv för att fungera inom tictail?
 
Nä, helt sant. Kan du ta bort
Bra genomgång av Angular
 
Tack!
 
1:59 PM
Inga problem, hojta till om du kör fast. @lowebackstrom
 
är ngTictail nödvändig eller går det att lösa på annat sätt?
schysst. uppskattar det verkligen!
 
Nä, det är inte heller nödvändigt. Till för om du vill använda apier från tt.js.
Hare gött och lycka till!
 
ok super. återigen tack!
 

last day (14 days later) »